Discussion:
New to Inline::Java and a quick question
David Wang
2013-12-12 00:25:14 UTC
Permalink
Hi


I am very new to this stuff, just started to hear about it today. I looked around the web and I find the installation
instructions for inline::c like the following

perl Makefile.PL;
make;
make test;
make install;

But I can't find anywhere else that tells us how to install inline::Java ? BTW, I found the latest Inline is Inline-0.53.tar.gz  and I use Redhat 5

Thanks

David
David Wang
2013-12-12 00:38:01 UTC
Permalink
Ok, I figured it out. Hope it can be documented somewhere.

Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some nice guy

Thanks

David



________________________________
From: David Wang <kuoweiwang-/***@public.gmane.org>
To: "inline-***@public.gmane.org" <***@perl.org>
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question



Hi


I am very new to this stuff, just started to hear about it today. I looked around the web and I find the installation
instructions for inline::c like the following

perl Makefile.PL;
make;
make test;
make install;

But I can't find anywhere else that tells us how to install inline::Java ? BTW, I found the latest Inline is Inline-0.53.tar.gz  and I use Redhat 5


Thanks

David
David Mertens
2013-12-12 13:37:56 UTC
Permalink
Yep, as a rule, if you need to install a Perl module, a simple "cpan
Module::Name" should do it. If you are on a Unixish system, you may have
installation permission issues, in which case there are known work-arounds.
But I'm sure you'll ask when you come to those. :-)

Good luck, and don't be afraid to ask more questions as they come up!

David
Post by David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
------------------------------
*Sent:* Wednesday, December 11, 2013 4:25 PM
*Subject:* New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it today. I looked
around the web and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to install inline::Java ?
BTW, I found the latest Inline is Inline-0.53.tar.gz and I use Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Wang
2013-12-13 00:57:26 UTC
Permalink
Thanks

I am not sure if anybody has any experience with perl Inline::Java to call Java JAXB . Basically, I have added some code in my perl script to call some of my Java API that calls JAXB.

System.out.println(“before
”);
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println(“after
”);

and it fails on the JAXB statement above. I then added Debug and AUTOSTUDY  option in perl like below

use Inline (
    Java => 'DATA',
    J2SDK => $ENV{JAVA_HOME},
    CLASSPATH => 'classes',

    AUTOSTUDY => 1,
    DEBUG => 4,
);

then I see
[java][3]   packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   checking if stub is array...
[perl][3]   perl doesn't know about 'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
[perl][2]  autostudying javax.xml.bind.JAXBException...
[perl][3]   perl doesn't know about 'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
[perl][3]   reporting on javax.xml.bind.JAXBException

I hope perl inline works with JAXB . BTW, my Java API works fine meaning I use a Java main to call this
API and the xml file is loaded without problem.

thanks,

David





________________________________
From: David Mertens <***@gmail.com>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: "inline-***@public.gmane.org" <inline-***@public.gmane.org>
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question



Yep, as a rule, if you need to install a Perl module, a simple "cpan Module::Name" should do it. If you are on a Unixish system, you may have installation permission issues, in which case there are known work-arounds. But I'm sure you'll ask when you come to those. :-)

Good luck, and don't be afraid to ask more questions as they come up!

David




On Wed, Dec 11, 2013 at 7:38 PM, David Wang <kuoweiwang-/***@public.gmane.org> wrote:

Ok, I figured it out. Hope it can be documented somewhere.
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some nice guy
Thanks
David
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it today. I looked around the web and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to install inline::Java ? BTW, I found the latest Inline is Inline-0.53.tar.gz  and I use Redhat 5
Thanks
David
--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
Russ Tremain
2013-12-13 01:05:56 UTC
Permalink
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
I have used it extensively with JDBC.pm. Example of this can be found here:

https://github.com/russt/sqlpj

best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience with
perl Inline::Java to call Java JAXB . Basically,
I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("beforeŠ");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("afterŠ");
and it fails on the JAXB statement above. I then
added Debug and AUTOSTUDY option in perl like
below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main to
call this
API and the xml file is loaded without problem.
thanks,
David
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may have
installation permission issues, in which case
there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web and
I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how
to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Wang
2013-12-13 01:18:18 UTC
Permalink
Thanks. my perl version is v5.8.8 . It works with Java fine. Just not with JAXB at this current
moment.


________________________________
From: Russ Tremain <russt-***@public.gmane.org>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: David Mertens <dcmertens.perl-***@public.gmane.org>; "***@perl.org" <inline-***@public.gmane.org>
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question



Re: New to Inline::Java and a quick
question
one thing I can tell you is I have never gotten Inline::Java to
work with any perl later than 5.8.9.
I have used it extensively with JDBC.pm.  Example of this
can be found here:

        https://github.com/russt/sqlpj

best of luck!
-Russ


At 4:57 PM -0800 12/12/13, David Wang wrote:
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
System.out.println("beforeÅ ");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
System.out.println("afterÅ ");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like
below
use Inline (
    Java =>
'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
    CLASSPATH =>
'classes',
    AUTOSTUDY =>
1,
    DEBUG =>
4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   checking if stub is
array...
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2]  autostudying
javax.xml.bind.JAXBException...
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3]   reporting on
javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call
this
API and the xml file is loaded without
problem.
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the
installation
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian
Kernighan
Russ Tremain
2013-12-13 03:32:01 UTC
Permalink
can you publish your full example? I can try it
my environment to see if it works for me.

Also, when you installed inline::Java, did it pass all the tests?
Thanks. my perl version is v5.8.8 . It works
with Java fine. Just not with JAXB at this
current
moment.
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv3571647833 #yiv3571647833 -- blockquote,
#yiv3571647833 dl, #yiv3571647833 ul,
#yiv3571647833 ol, #yiv3571647833 li
{padding-top:0;padding-bottom:0;} #yiv3571647833
Re: New to Inline::Java and a quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
https://github.com/russt/sqlpj
best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience
with perl Inline::Java to call Java JAXB .
Basically, I have added some code in my perl
script to call some of my Java API that calls
JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I
then added Debug and AUTOSTUDY option in perl
like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main
to call this
API and the xml file is loaded without problem.
thanks,
David
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may
have installation permission issues, in which
case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web
and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us
how to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Wang
2013-12-13 07:06:26 UTC
Permalink
Hi Russ

Thanks. Pls do the following

In your perlAPI.pm add the following (in the same file).

==> perl script calls

eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};

==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.util.*;

public class MyJAXB { 
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context = JAXBContext.newInstance("com.example.foo:com.example.bar");
    System.out.println("checkpoint2");

  }
}


 "checkpoint2" will never be reached. If you do the DEBUG =>4, you will see the error

[perl][3]   perl doesn't know about 'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')

use Inline (
    Java => 'DATA',
    J2SDK => $ENV{JAVA_HOME},
    CLASSPATH => 'classes',

    DEBUG => 4,
);

Pls let me know how it goes. I really hope its something I did wrong meaning it works on your end.


________________________________
From: Russ Tremain <russt-***@public.gmane.org>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: "inline-***@public.gmane.org" <***@perl.org>
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question



Re: New to Inline::Java and a quick
question
can you publish your full example?  I can try it my
environment to see if it works for me.

Also, when you installed inline::Java, did it pass all the
tests?

At 5:18 PM -0800 12/12/13, David Wang wrote:
Thanks. my perl version is v5.8.8 .
It works with Java fine. Just not with JAXB at this
current
moment.
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick
question
#yiv3571647833 #yiv3571647833 --
blockquote, #yiv3571647833 dl, #yiv3571647833 ul, #yiv3571647833 ol,
#yiv3571647833 li {padding-top:0;padding-bottom:0;} #yiv3571647833 Re:
New to Inline::Java and a quick question
one thing I can tell you is I have never
gotten Inline::Java to work with any perl later than
5.8.9.
I have used it extensively with JDBC.pm. 
Example of this can be found here:
       
https://github.com/russt/sqlpj
best of luck!
-Russ
At 4:57 PM -0800 12/12/13, David Wang
Post by David Wang
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
Post by David Wang
System.out.println("before·");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
Post by David Wang
System.out.println("after·");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like below
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
Post by David Wang
    CLASSPATH =>
'classes',
Post by David Wang
    AUTOSTUDY => 1,
    DEBUG => 4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
[perl][3]   checking if stub is
array...
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
[perl][2]  autostudying
javax.xml.bind.JAXBException...
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
[perl][3]   reporting on
javax.xml.bind.JAXBException
Post by David Wang
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call this
Post by David Wang
API and the xml file is loaded without
problem.
Post by David Wang
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the installation
Post by David Wang
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you
are,
Post by David Wang
Post by David Wang
  by definition, not smart enough to debug it." -- Brian
Kernighan
Patrick LeBoutillier
2013-12-13 11:45:01 UTC
Permalink
Hi,

If I run this:

use strict ;

use Inline (
Java => 'DATA',
DEBUG => 0,
AUTOSTUDY => 1,
);


my $t = new MyJAXB() ;


__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.util.*;

public class MyJAXB {
public MyJAXB() throws javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");

}
}


I get this:

checkpoint1
Unexpected exception of type 'javax.xml.bind.JAXBException':
"com.example.foo" doesnt contain ObjectFactory.class or jaxb.index at
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Inline/Java/Object.pm
line 49
at t.pl line 10
at t.pl line 10

Don't know enough about JAXB to continue...

Patrick
Post by David Wang
Hi Russ
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same file).
==> perl script calls
eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
public MyJAXB() throws javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");
}
}
"checkpoint2" will never be reached. If you do the DEBUG =>4, you will
see the error
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
DEBUG => 4,
);
Pls let me know how it goes. I really hope its something I did wrong
meaning it works on your end.
------------------------------
*Sent:* Thursday, December 12, 2013 7:32 PM
*Subject:* Re: New to Inline::Java and a quick question
can you publish your full example? I can try it my environment to see if
it works for me.
Also, when you installed inline::Java, did it pass all the tests?
Thanks. my perl version is v5.8.8 . It works with Java fine. Just not with
JAXB at this current
moment.
------------------------------
*Sent:* Thursday, December 12, 2013 5:05 PM
*Subject:* Re: New to Inline::Java and a quick question
#yiv3571647833 #yiv3571647833 -- blockquote, #yiv3571647833 dl,
#yiv3571647833 ul, #yiv3571647833 ol, #yiv3571647833 li
{padding-top:0;padding-bottom:0;} #yiv3571647833 Re: New to Inline::Java
and a quick question
one thing I can tell you is I have never gotten Inline::Java to work with
any perl later than 5.8.9.
I have used it extensively with JDBC.pm. Example of this can be found
https://github.com/russt/sqlpj
best of luck!
-Russ
Thanks
I am not sure if anybody has any experience with perl Inline::Java to call
Java JAXB . Basically, I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then added Debug and AUTOSTUDY
option in perl like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my Java API works fine meaning I
use a Java main to call this
API and the xml file is loaded without problem.
thanks,
David
------------------------------
*Sent:* Thursday, December 12, 2013 5:37 AM
*Subject:* Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl module, a simple "cpan
Module::Name" should do it. If you are on a Unixish system, you may have
installation permission issues, in which case there are known work-arounds.
But I'm sure you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
------------------------------
*Sent:* Wednesday, December 11, 2013 4:25 PM
*Subject:* New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it today. I looked
around the web and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to install inline::Java ?
BTW, I found the latest Inline is Inline-0.53.tar.gz and I use Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
David Wang
2013-12-13 19:28:45 UTC
Permalink
Hi Patrick and the rest

I made a very simple example. This example shows how a Main.java calls the JAXB stuff and the same calls in Perl script failed.

Once you download the file, untar, to compile and run in Java, you do
javac -d classes Main.java
java -cp .:classes Main

To run in perl
perl main.pl

You will see that the following line always fails in perl .
JAXBContext context = JAXBContext.newInstance("sample");

JAXB is a very powerful utility in Java that saves lots of coding to parse XML (you basically don't need to write any code to parse, its all done automatically). I have way too many existing perl scripts that can take the advantage of JAXB if this would work.

Thanks for your help.

David


________________________________
From: Patrick LeBoutillier <patrick.leboutillier-***@public.gmane.org>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: Russ Tremain <russt-***@public.gmane.org>; "inline-***@public.gmane.org" <inline-***@public.gmane.org>
Sent: Friday, December 13, 2013 3:45 AM
Subject: Re: New to Inline::Java and a quick question



Hi,

If I run this:

use strict ;

use Inline (
    Java => 'DATA',
    DEBUG => 0,
    AUTOSTUDY => 1,
);


my $t = new MyJAXB() ;


__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.util.*;

public class MyJAXB {
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context = JAXBContext.newInstance("com.example.foo:com.example.bar");
    System.out.println("checkpoint2");

  }
}


I get this:

checkpoint1
Unexpected exception of type 'javax.xml.bind.JAXBException': "com.example.foo" doesnt contain ObjectFactory.class or jaxb.index at /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Inline/Java/Object.pm line 49
 at t.pl line 10
 at t.pl line 10

Don't know enough about JAXB to continue...

Patrick






On Fri, Dec 13, 2013 at 2:06 AM, David Wang <kuoweiwang-/***@public.gmane.org> wrote:

Hi Russ
Post by David Wang
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same file).
==> perl script calls
eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB { 
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context = JAXBContext.newInstance("com.example.foo:com.example.bar");
    System.out.println("checkpoint2");
  }
}
 "checkpoint2" will never be reached. If you do the DEBUG =>4, you will see the error
[perl][3]   perl doesn't know about 'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
use Inline (
    Java => 'DATA',
    J2SDK => $ENV{JAVA_HOME},
    CLASSPATH => 'classes',
    DEBUG => 4,
);
Pls let me know how it goes. I really hope its something I did wrong meaning it works on your end.
________________________________
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question
can you publish your full example?  I can try it my
environment to see if it works for me.
Post by David Wang
Also, when you installed inline::Java, did it pass all the
tests?
Post by David Wang
Thanks. my perl version is v5.8.8 .
It works with Java fine. Just not with JAXB at this
current
Post by David Wang
moment.
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
#yiv3571647833 #yiv3571647833 --
blockquote, #yiv3571647833 dl, #yiv3571647833 ul, #yiv3571647833 ol,
#yiv3571647833 li {padding-top:0;padding-bottom:0;} #yiv3571647833 Re:
New to Inline::Java and a quick question
Post by David Wang
one thing I can tell you is I have never
gotten Inline::Java to work with any perl later than
5.8.9.
Post by David Wang
I have used it extensively with JDBC.pm. 
        https://github.com/russt/sqlpj
best of luck!
-Russ
At 4:57 PM -0800 12/12/13, David Wang
Post by David Wang
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
Post by David Wang
Post by David Wang
System.out.println("before·");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
Post by David Wang
Post by David Wang
System.out.println("after·");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like below
Post by David Wang
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
Post by David Wang
Post by David Wang
    CLASSPATH =>
'classes',
Post by David Wang
Post by David Wang
    AUTOSTUDY => 1,
    DEBUG => 4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
[perl][3]   checking if stub is
array...
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
[perl][2]  autostudying
javax.xml.bind.JAXBException...
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
[perl][3]   reporting on
javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call this
Post by David Wang
Post by David Wang
API and the xml file is loaded without
problem.
Post by David Wang
Post by David Wang
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Post by David Wang
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Post by David Wang
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Post by David Wang
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the installation
Post by David Wang
Post by David Wang
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
Post by David Wang
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you
are,
Post by David Wang
Post by David Wang
Post by David Wang
  by definition, not smart enough to debug it." -- Brian
Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
David Wang
2013-12-13 20:12:12 UTC
Permalink
Hi Sorry for the spam. I found the solution.

In Perl, we need to add the class loader, can't use the default one. Therefore, to make the long story short, the code where is called in perlAPI.pm should look like the following. 

    ClassLoader cl = sample.ObjectFactory.class.getClassLoader();

    System.out.println("============================> checkpoint1");
    JAXBContext context = JAXBContext.newInstance("sample", cl);
    System.out.println("==============================>checkpoint2");





________________________________
From: David Wang <***@yahoo.com>
To: Patrick LeBoutillier <patrick.leboutillier-***@public.gmane.org>
Cc: Russ Tremain <russt-***@public.gmane.org>; "inline-***@public.gmane.org" <inline-***@public.gmane.org>
Sent: Friday, December 13, 2013 11:28 AM
Subject: Re: New to Inline::Java and a quick question



Hi Patrick and the rest

I made a very simple example. This example shows how a Main.java calls the JAXB stuff and the same calls in Perl script failed.

Once you download the file, untar, to compile and run in Java, you do
javac -d classes Main.java
java -cp .:classes Main

To run in perl
perl main.pl

You will see that the following line always fails in perl .
JAXBContext context = JAXBContext.newInstance("sample");

JAXB is a very powerful utility in Java that saves lots of coding to parse XML (you basically don't need to write any code to parse, its all done automatically). I have way too many existing perl scripts that can take the advantage of JAXB if this would work.

Thanks for your help.

David


________________________________
From: Patrick LeBoutillier <patrick.leboutillier-***@public.gmane.org>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: Russ Tremain <russt-***@public.gmane.org>; "inline-***@public.gmane.org" <inline-***@public.gmane.org>
Sent: Friday, December 13, 2013 3:45 AM
Subject: Re: New to Inline::Java and a quick question



Hi,

If I run this:

use strict ;

use Inline (
    Java => 'DATA',
    DEBUG => 0,
    AUTOSTUDY => 1,
);


my $t = new MyJAXB() ;


__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.util.*;

public class MyJAXB {
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context = JAXBContext.newInstance("com.example.foo:com.example.bar");
    System.out.println("checkpoint2");

  }
}


I get this:

checkpoint1
Unexpected exception of type 'javax.xml.bind.JAXBException': "com.example.foo" doesnt contain ObjectFactory.class or jaxb.index at /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Inline/Java/Object.pm line 49
 at t.pl line 10
 at t.pl line 10

Don't know enough about JAXB to continue...

Patrick






On Fri, Dec 13, 2013 at 2:06 AM, David Wang <kuoweiwang-/***@public.gmane.org> wrote:

Hi Russ
Post by David Wang
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same file).
==> perl script calls
eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB { 
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context = JAXBContext.newInstance("com.example.foo:com.example.bar");
    System.out.println("checkpoint2");
  }
}
 "checkpoint2" will never be reached. If you do the DEBUG =>4, you will see the error
[perl][3]   perl doesn't know about 'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
use Inline (
    Java => 'DATA',
    J2SDK => $ENV{JAVA_HOME},
    CLASSPATH => 'classes',
    DEBUG => 4,
);
Pls let me know how it goes. I really hope its something I did wrong meaning it works on your end.
________________________________
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question
can you publish your full example?  I can try it my
environment to see if it works for me.
Post by David Wang
Also, when you installed inline::Java, did it pass all the
tests?
Post by David Wang
Thanks. my perl version is v5.8.8 .
It works with Java fine. Just not with JAXB at this
current
Post by David Wang
moment.
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
#yiv3571647833 #yiv3571647833 --
blockquote, #yiv3571647833 dl, #yiv3571647833 ul, #yiv3571647833 ol,
#yiv3571647833 li {padding-top:0;padding-bottom:0;} #yiv3571647833 Re:
New to Inline::Java and a quick question
Post by David Wang
one thing I can tell you is I have never
gotten Inline::Java to work with any perl later than
5.8.9.
Post by David Wang
I have used it extensively with JDBC.pm. 
        https://github.com/russt/sqlpj
best of luck!
-Russ
At 4:57 PM -0800 12/12/13, David Wang
Post by David Wang
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
Post by David Wang
Post by David Wang
System.out.println("before·");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
Post by David Wang
Post by David Wang
System.out.println("after·");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like below
Post by David Wang
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
Post by David Wang
Post by David Wang
    CLASSPATH =>
'classes',
Post by David Wang
Post by David Wang
    AUTOSTUDY => 1,
    DEBUG => 4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
[perl][3]   checking if stub is
array...
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
[perl][2]  autostudying
javax.xml.bind.JAXBException...
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
[perl][3]   reporting on
javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call this
Post by David Wang
Post by David Wang
API and the xml file is loaded without
problem.
Post by David Wang
Post by David Wang
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Post by David Wang
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Post by David Wang
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Post by David Wang
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the installation
Post by David Wang
Post by David Wang
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
Post by David Wang
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you
are,
Post by David Wang
Post by David Wang
Post by David Wang
  by definition, not smart enough to debug it." -- Brian
Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Russ Tremain
2013-12-13 20:29:50 UTC
Permalink
you should also always check for exceptions as
per my previousl example. i.e., in your
perlAPI.pm:

sub new {

my $self = {};
bless($self, $class);

eval {
$self->{CONNECTION} = new perlAPI::MyJAXB();
};

if ($@){
if (Inline::Java::caught("java.lang.Exception")) {
my $msg = $@->getMessage() ;
printf "PERL CAUGHT java exception: '%s'\n", $msg;
}
else{
#unexpected Inline::Java exception:
printf "PERL CAUGHT UNEXPECTED EXCEPTION: '%s'\n", $@;
}

return undef;
}

return $self;
}

your current code is ignoring the exception silently.

Maybe Patrick can help on why Inline::Java is not
catching the java exception, but at any rate, the
error from eval is the same as the one from java.

-Russ
Post by David Wang
Hi Sorry for the spam. I found the solution.
In Perl, we need to add the class loader, can't
use the default one. Therefore, to make the long
story short, the code where is called in
perlAPI.pm should look like the following.
ClassLoader cl = sample.ObjectFactory.class.getClassLoader();
System.out.println("============================> checkpoint1");
JAXBContext context = JAXBContext.newInstance("sample", cl);
System.out.println("==============================>checkpoint2");
Sent: Friday, December 13, 2013 11:28 AM
Subject: Re: New to Inline::Java and a quick question
Hi Patrick and the rest
I made a very simple example. This example shows
how a Main.java calls the JAXB stuff and the
same calls in Perl script failed.
Once you download the file, untar, to compile and run in Java, you do
javac -d classes Main.java
java -cp .:classes Main
To run in perl
perl main.pl
You will see that the following line always fails in perl .
JAXBContext context = JAXBContext.newInstance("sample");
JAXB is a very powerful utility in Java that
saves lots of coding to parse XML (you basically
don't need to write any code to parse, its all
done automatically). I have way too many
existing perl scripts that can take the
advantage of JAXB if this would work.
Thanks for your help.
David
Sent: Friday, December 13, 2013 3:45 AM
Subject: Re: New to Inline::Java and a quick question
Hi,
use strict ;
use Inline (
Java => 'DATA',
DEBUG => 0,
AUTOSTUDY => 1,
);
my $t = new MyJAXB() ;
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
public MyJAXB() throws javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");
}
}
checkpoint1
Unexpected exception of type
"com.example.foo" doesnt contain
ObjectFactory.class or jaxb.index at
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Inline/Java/Object.pm
line 49
at <http://t.pl/>t.pl line 10
at <http://t.pl/>t.pl line 10
Don't know enough about JAXB to continue...
Patrick
On Fri, Dec 13, 2013 at 2:06 AM, David Wang
Hi Russ
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same file).
==> perl script calls
eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
public MyJAXB() throws javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");
}
}
"checkpoint2" will never be reached. If you do
the DEBUG =>4, you will see the error
Post by David Wang
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
DEBUG => 4,
);
Pls let me know how it goes. I really hope its
something I did wrong meaning it works on your
end.
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question
can you publish your full example? I can try it
my environment to see if it works for me.
Also, when you installed inline::Java, did it pass all the tests?
Thanks. my perl version is v5.8.8 . It works
with Java fine. Just not with JAXB at this
current
moment.
Cc: David Mertens
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv3571647833 #yiv3571647833 -- blockquote,
#yiv3571647833 dl, #yiv3571647833 ul,
#yiv3571647833 ol, #yiv3571647833 li
{padding-top:0;padding-bottom:0;} #yiv3571647833
Re: New to Inline::Java and a quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
<https://github.com/russt/sqlpj>https://github.com/russt/sqlpj
best of luck!
-Russ
Thanks
I am not sure if anybody has any experience with
perl Inline::Java to call Java JAXB . Basically,
I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then
added Debug and AUTOSTUDY option in perl like
below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main to
call this
API and the xml file is loaded without problem.
thanks,
David
From: David Mertens
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may have
installation permission issues, in which case
there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web and
I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how
to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
David Wang
2013-12-13 21:55:37 UTC
Permalink
Absolutely. Thanks a lot for the help and sorry for the spam again.


________________________________
From: Russ Tremain <***@releasetools.org>
To: David Wang <kuoweiwang-/***@public.gmane.org>
Cc: Patrick LeBoutillier <patrick.leboutillier-***@public.gmane.org>; "inline-***@public.gmane.org" <inline-***@public.gmane.org>
Sent: Friday, December 13, 2013 12:29 PM
Subject: Re: New to Inline::Java and a quick question



Re: New to Inline::Java and a quick
question
you should also always check for exceptions as per my previousl
example.  i.e., in your perlAPI.pm:

sub new {

    my $self = {};
    bless($self, $class);
    
    eval {
        $self->{CONNECTION} =
new perlAPI::MyJAXB();
    };

    if ($@){
        if
(Inline::Java::caught("java.lang.Exception")) {
            my
$msg = $@->getMessage() ;
           
printf "PERL CAUGHT java exception: '%s'\n", $msg;
        }
        else{
           
#unexpected Inline::Java exception:
           
printf "PERL CAUGHT UNEXPECTED EXCEPTION: '%s'\n", $@;
        }

        return undef;
    }  

    return $self;
}   

your current code is ignoring the exception
silently.     

Maybe Patrick can help on why Inline::Java is not catching the
java exception, but at any rate, the error from eval is the same as
the one from java.

-Russ

At 12:12 PM -0800 12/13/13, David Wang wrote:
Hi Sorry for the spam. I found the
solution.
In Perl, we need to add the class loader,
can't use the default one. Therefore, to make the long story short,
the code where is called in perlAPI.pm should look like the
following.
    ClassLoader cl =
sample.ObjectFactory.class.getClassLoader();
   
System.out.println("============================>
checkpoint1");
    JAXBContext context =
JAXBContext.newInstance("sample", cl);
   
System.out.println("==============================>checkpoint2");
Post by David Wang
________________________________
To: Patrick LeBoutillier
Sent: Friday, December 13, 2013 11:28 AM
Subject: Re: New to Inline::Java and a quick
question
Hi Patrick and the rest
I made a very simple example. This
example shows how a Main.java calls the JAXB stuff and the same calls
in Perl script failed.
Once you download the file, untar, to
compile and run in Java, you do
javac -d classes Main.java
java -cp .:classes Main
To run in perl
perl main.pl
You will see that the following line
always fails in perl .
JAXBContext context =
JAXBContext.newInstance("sample");
JAXB is a very powerful utility in Java
that saves lots of coding to parse XML (you basically don't need to
write any code to parse, its all done automatically). I have way too
many existing perl scripts that can take the advantage of JAXB if this
would work.
Thanks for your help.
David
Post by David Wang
________________________________
Sent: Friday, December 13, 2013 3:45 AM
Subject: Re: New to Inline::Java and a quick
question
Hi,
Post by David Wang
use strict ;
use Inline (
    Java => 'DATA',
    DEBUG => 0,
    AUTOSTUDY => 1,
);
my $t = new MyJAXB() ;
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
  public MyJAXB() throws javax.xml.bind.JAXBException,
      FileNotFoundException, SAXException
  {
    System.out.println("checkpoint1");
    JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
Post by David Wang
    System.out.println("checkpoint2");
  }
}
checkpoint1
"com.example.foo" doesnt contain ObjectFactory.class or
jaxb.index at
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/Inline/Java/Object.pm line 49
 at t.pl line 10
Post by David Wang
 at t.pl line 10
Don't know enough about JAXB to
continue...
Patrick
On Fri, Dec 13, 2013 at 2:06 AM, David
Post by David Wang
Hi Russ
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same
file).
Post by David Wang
==> perl script calls
eval {$self->{CONNECTION} = new
perlAPI::MyJAXB();};
Post by David Wang
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import
javax.xml.parsers.DocumentBuilderFactory;
Post by David Wang
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
  public MyJAXB() throws
javax.xml.bind.JAXBException,
Post by David Wang
      FileNotFoundException,
SAXException
Post by David Wang
  {
   
System.out.println("checkpoint1");
Post by David Wang
    JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
Post by David Wang
   
System.out.println("checkpoint2");
Post by David Wang
  }
}
 "checkpoint2" will never be reached. If
you do the DEBUG =>4, you will see the error
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know
about
'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
Post by David Wang
    CLASSPATH => 'classes',
    DEBUG => 4,
);
Pls let me know how it goes. I really hope its something I
did wrong meaning it works on your end.
Post by David Wang
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question
can you publish your full example?  I can try it my
environment to see if it works for me.
Post by David Wang
Also, when you installed inline::Java, did it pass all the
tests?
Post by David Wang
Post by David Wang
Thanks. my perl version is v5.8.8 .
It works with Java fine. Just not with JAXB at this current
Post by David Wang
moment.
Post by David Wang
Post by David Wang
________________________________
From: Russ Tremain
Post by David Wang
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Post by David Wang
#yiv3571647833 #yiv3571647833 -- blockquote,
#yiv3571647833 dl, #yiv3571647833 ul, #yiv3571647833 ol,
#yiv3571647833 li {padding-top:0;padding-bottom:0;} #yiv3571647833 Re:
New to Inline::Java and a quick question
Post by David Wang
Post by David Wang
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than 5.8.9.
Post by David Wang
Post by David Wang
I have used it extensively with JDBC.pm.  Example of
        https://github.com/russt/sqlpj
best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience with perl
Inline::Java to call Java JAXB . Basically, I have added some code in
my perl script to call some of my Java API that calls JAXB.
Post by David Wang
Post by David Wang
Post by David Wang
System.out.println("before·");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
Post by David Wang
Post by David Wang
Post by David Wang
System.out.println("after·");
and it fails on the JAXB statement above. I then added
Debug and AUTOSTUDY  option in perl like below
Post by David Wang
Post by David Wang
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK => $ENV{JAVA_HOME},
    CLASSPATH => 'classes',
    AUTOSTUDY => 1,
    DEBUG => 4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
Post by David Wang
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
Post by David Wang
[perl][3]   checking if stub is
array...
Post by David Wang
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
Post by David Wang
[perl][2]  autostudying
javax.xml.bind.JAXBException...
Post by David Wang
Post by David Wang
Post by David Wang
[perl][3]   perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
Post by David Wang
Post by David Wang
[perl][3]   reporting on
javax.xml.bind.JAXBException
Post by David Wang
Post by David Wang
Post by David Wang
I hope perl inline works with JAXB . BTW, my Java API
works fine meaning I use a Java main to call this
Post by David Wang
Post by David Wang
Post by David Wang
API and the xml file is loaded without problem.
thanks,
David
Post by David Wang
________________________________
From: David Mertens
Post by David Wang
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Post by David Wang
Post by David Wang
Yep, as a rule, if you need to install a Perl module, a
simple "cpan Module::Name" should do it. If you are on a
Unixish system, you may have installation permission issues, in which
case there are known work-arounds. But I'm sure you'll ask when you
come to those. :-)
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the installation
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you
are,
Post by David Wang
Post by David Wang
Post by David Wang
Post by David Wang
  by definition, not smart enough to debug it." -- Brian
Kernighan
Post by David Wang
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Russ Tremain
2013-12-13 20:10:25 UTC
Permalink
The problem is your constructor is generating an
exception, which you are not catching in your
perl code. Try creating the following files and
then:

$ javac MyJAXB.java testMyJAXB.java
$ perl testjaxb.pl
hello world args length is 1
arg[0]=HELLO FROM PERL
checkpoint1
JAVA CAUGHT EXCEPTION: "com.example.foo" doesnt
contain ObjectFactory.class or jaxb.index
checkpoint1
PERL CAUGHT UNEXPECTED EXCEPTION: 'Unexpected
exception of type 'javax.xml.bind.JAXBException':
"com.example.foo" doesnt contain
ObjectFactory.class or jaxb.index at
/usr/local/perl/lib/site_perl/5.8.9/darwin-2level/Inline/Java/Object.pm
line 49.
at testjaxb.pl line 18.
at testjaxb.pl line 18.
'

Note that Inline::Java::caught() is *not*
catching the java exception. Possibly because
the MyJAXB object was never created, the
exception object was also destroyed.

-Russ

==> testjaxb.pl <==
package main;

use Inline::Java qw(caught);
use Inline (
Java => 'STUDY',
STUDY => ['testMyJAXB', 'MyJAXB'],
CLASSPATH => '.',
) ;

my $obj;

$obj = main::testMyJAXB->new();
$obj->main(["HELLO FROM PERL"]);

#now create MyJAXB, but catch the exception in perl instead of java:
eval {
$obj = main::MyJAXB->new();
};

if ($@){
if (caught("java.lang.Exception")) {
my $msg = $@->getMessage() ;
printf "PERL CAUGHT java exception: '%s'\n", $msg;
}
else{
#unexpected Inline::Java exception:
printf "PERL CAUGHT UNEXPECTED EXCEPTION: '%s'\n", $@;
}
}

==> MyJAXB.java <==
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import java.util.*;

public class MyJAXB {
public MyJAXB() throws
javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");
}
}

==> testMyJAXB.java <==
public class testMyJAXB {
public static void main(String[] args) {

System.out.println("hello world args length is " + args.length );

for (int ii=0; ii< args.length; ii++) {
System.out.println("arg["+ii+"]="+args[ii]);
}


try {
MyJAXB xx = new MyJAXB();
} catch (Exception e) {
System.out.println("CAUGHT EXCEPTION: " + e.getMessage());
}

return;
}
}
Post by David Wang
Hi Russ
Thanks. Pls do the following
In your perlAPI.pm add the following (in the same file).
==> perl script calls
eval {$self->{CONNECTION} = new perlAPI::MyJAXB();};
==> The following is the Java JAXB stuff
__DATA__
__Java__
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import java.util.*;
public class MyJAXB {
public MyJAXB() throws javax.xml.bind.JAXBException,
FileNotFoundException, SAXException
{
System.out.println("checkpoint1");
JAXBContext context =
JAXBContext.newInstance("com.example.foo:com.example.bar");
System.out.println("checkpoint2");
}
}
"checkpoint2" will never be reached. If you do
the DEBUG =>4, you will see the error
Post by David Wang
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException' ('perlAPI::javax::xml::bind::JAXBException')
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
DEBUG => 4,
);
Pls let me know how it goes. I really hope its
something I did wrong meaning it works on your
end.
Sent: Thursday, December 12, 2013 7:32 PM
Subject: Re: New to Inline::Java and a quick question
#yiv7039752953 #yiv7039752953 -- blockquote,
#yiv7039752953 dl, #yiv7039752953 ul,
#yiv7039752953 ol, #yiv7039752953 li
{padding-top:0;padding-bottom:0;} #yiv7039752953
Re: New to Inline::Java and a quick question
can you publish your full example? I can try it
my environment to see if it works for me.
Also, when you installed inline::Java, did it pass all the tests?
Thanks. my perl version is v5.8.8 . It works
with Java fine. Just not with JAXB at this
current
moment.
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv3571647833 #yiv3571647833 -- blockquote,
#yiv3571647833 dl, #yiv3571647833 ul,
#yiv3571647833 ol, #yiv3571647833 li
{padding-top:0;padding-bottom:0;}
#yiv3571647833 Re: New to Inline::Java and a
quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
https://github.com/russt/sqlpj
best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience
with perl Inline::Java to call Java JAXB .
Basically, I have added some code in my perl
script to call some of my Java API that calls
JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I
then added Debug and AUTOSTUDY option in perl
like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main
to call this
API and the xml file is loaded without problem.
thanks,
David
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may
have installation permission issues, in which
case there are known work-arounds. But I'm
sure you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web
and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us
how to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
David Wang
2013-12-17 00:40:45 UTC
Permalink
Hi Russ

So I got the Inline:Java including JAXB to work on my v5.8.8 perfectly . Then, I remember you mentioned that you never got it/Java to work on any Perl version later than 5.8.9 . Now, I am starting to worry since my deploy machine uses v5.10.0 . The Inline version I use is Inline-0.53 . Can someone confirm if this will or will not work on Perl version v5.10.0?

Thanks

David


________________________________
From: Russ Tremain <russt-***@public.gmane.org>
To: David Wang <***@yahoo.com>
Cc: David Mertens <dcmertens.perl-***@public.gmane.org>; "***@perl.org" <inline-***@public.gmane.org>
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question



Re: New to Inline::Java and a quick
question
one thing I can tell you is I have never gotten Inline::Java to
work with any perl later than 5.8.9.
I have used it extensively with JDBC.pm.  Example of this
can be found here:

        https://github.com/russt/sqlpj

best of luck!
-Russ


At 4:57 PM -0800 12/12/13, David Wang wrote:
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
System.out.println("beforeÅ ");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
System.out.println("afterÅ ");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like
below
use Inline (
    Java =>
'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
    CLASSPATH =>
'classes',
    AUTOSTUDY =>
1,
    DEBUG =>
4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
[perl][3]   checking if stub is
array...
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2]  autostudying
javax.xml.bind.JAXBException...
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3]   reporting on
javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call
this
API and the xml file is loaded without
problem.
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the
installation
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian
Kernighan
Russ Tremain
2013-12-17 02:08:43 UTC
Permalink
Well, I'm using JDBC.pm to access the
inline::Java stuff, and I could never get it to
work with >5.8.9, and never got any response from
Tim Bunce or Patrick, so I eventually gave up on
it.

It is possible that JDBC is doing something
different, but I doubt it, as it is a very simple
module. It basically does a lot of runtime
"studying" in order to add all the java.sql
classes to main:: to make it easier to call.

Best you can do is to write some tests and try the later environment.

I could not get the JDBC tests to run in a later
env, and the tests have been broken on CPAN
testers for a long time.

-Russ
Post by David Wang
Hi Russ
So I got the Inline:Java including JAXB to work
on my v5.8.8 perfectly . Then, I remember you
mentioned that you never got it/Java to work on
any Perl version later than 5.8.9 . Now, I am
starting to worry since my deploy machine uses
v5.10.0 . The Inline version I use is
Inline-0.53 . Can someone confirm if this will
or will not work on Perl version v5.10.0?
Thanks
David
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv1198785418 #yiv1198785418 -- blockquote,
#yiv1198785418 dl, #yiv1198785418 ul,
#yiv1198785418 ol, #yiv1198785418 li
{padding-top:0;padding-bottom:0;} #yiv1198785418
Re: New to Inline::Java and a quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
https://github.com/russt/sqlpj
best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience
with perl Inline::Java to call Java JAXB .
Basically, I have added some code in my perl
script to call some of my Java API that calls
JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I
then added Debug and AUTOSTUDY option in perl
like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main
to call this
API and the xml file is loaded without problem.
thanks,
David
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may
have installation permission issues, in which
case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web
and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us
how to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
Patrick LeBoutillier
2013-12-17 02:30:29 UTC
Permalink
Hi,

I just ran the tests without issues on Fedora 17, Perl 5.14 and Java 1.7.0.
There's really not much in Inline::Java that is dependant on the perl
version.

Patrick
Well, I'm using JDBC.pm to access the inline::Java stuff, and I could
never get it to work with >5.8.9, and never got any response from Tim Bunce
or Patrick, so I eventually gave up on it.
It is possible that JDBC is doing something different, but I doubt it, as
it is a very simple module. It basically does a lot of runtime "studying"
in order to add all the java.sql classes to main:: to make it easier to
call.
Best you can do is to write some tests and try the later environment.
I could not get the JDBC tests to run in a later env, and the tests have
been broken on CPAN testers for a long time.
-Russ
Hi Russ
So I got the Inline:Java including JAXB to work on my v5.8.8 perfectly .
Then, I remember you mentioned that you never got it/Java to work on any
Perl version later than 5.8.9 . Now, I am starting to worry since my deploy
machine uses v5.10.0 . The Inline version I use is Inline-0.53 . Can
someone confirm if this will or will not work on Perl version v5.10.0?
Thanks
David
------------------------------
*Sent:* Thursday, December 12, 2013 5:05 PM
*Subject:* Re: New to Inline::Java and a quick question
#yiv1198785418 #yiv1198785418 -- blockquote, #yiv1198785418 dl,
#yiv1198785418 ul, #yiv1198785418 ol, #yiv1198785418 li
{padding-top:0;padding-bottom:0;} #yiv1198785418 Re: New to Inline::Java
and a quick question
one thing I can tell you is I have never gotten Inline::Java to work with
any perl later than 5.8.9.
I have used it extensively with JDBC.pm. Example of this can be found
https://github.com/russt/sqlpj
best of luck!
-Russ
Thanks
I am not sure if anybody has any experience with perl Inline::Java to call
Java JAXB . Basically, I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then added Debug and AUTOSTUDY
option in perl like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my Java API works fine meaning I
use a Java main to call this
API and the xml file is loaded without problem.
thanks,
David
------------------------------
*Sent:* Thursday, December 12, 2013 5:37 AM
*Subject:* Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl module, a simple "cpan
Module::Name" should do it. If you are on a Unixish system, you may have
installation permission issues, in which case there are known work-arounds.
But I'm sure you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
------------------------------
*Sent:* Wednesday, December 11, 2013 4:25 PM
*Subject:* New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it today. I looked
around the web and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to install inline::Java ?
BTW, I found the latest Inline is Inline-0.53.tar.gz and I use Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
David Wang
2013-12-17 18:02:59 UTC
Permalink
Thanks for the great responses. I am glad it is not as dependent as I thought.


________________________________
From: Patrick LeBoutillier <patrick.leboutillier-***@public.gmane.org>
To: Russ Tremain <russt-***@public.gmane.org>
Cc: David Wang <kuoweiwang-/***@public.gmane.org>; "inline-***@public.gmane.org" <***@perl.org>
Sent: Monday, December 16, 2013 6:30 PM
Subject: Re: New to Inline::Java and a quick question



Hi,

I just ran the tests without issues on Fedora 17, Perl 5.14 and Java 1.7.0.
There's really not much in Inline::Java that is dependant on the perl version.

Patrick
Well, I'm using JDBC.pm to access the inline::Java stuff, and I
could never get it to work with >5.8.9, and never got any response
from Tim Bunce or Patrick, so I eventually gave up on it.
It is possible that JDBC is doing something different, but I
doubt it, as it is a very simple module.  It basically does a lot
of runtime "studying" in order to add all the java.sql
classes to main:: to make it easier to call.
Best you can do is to write some tests and try the later
environment.
I could not get the JDBC tests to run in a later env, and the
tests have been broken on CPAN testers for a long time.
-Russ
Hi Russ
So I got the Inline:Java including JAXB
to work on my v5.8.8 perfectly . Then, I remember you mentioned
that you never got it/Java to work on any Perl version later than
5.8.9 . Now, I am starting to worry since my deploy machine uses
v5.10.0 . The Inline version I use is Inline-0.53 . Can someone
confirm if this will or will not work on Perl version
v5.10.0?
Thanks
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick
question
#yiv1198785418 #yiv1198785418 --
blockquote, #yiv1198785418 dl, #yiv1198785418 ul, #yiv1198785418 ol,
#yiv1198785418 li {padding-top:0;padding-bottom:0;} #yiv1198785418 Re:
New to Inline::Java and a quick question
one thing I can tell you is I have never
gotten Inline::Java to work with any perl later than
5.8.9.
I have used it extensively with JDBC.pm. 
        https://github.com/russt/sqlpj
best of luck!
-Russ
At 4:57 PM -0800 12/12/13, David Wang
Post by David Wang
Thanks
I am not sure if anybody has any
experience with perl Inline::Java to call Java JAXB . Basically, I
have added some code in my perl script to call some of my Java API
that calls JAXB.
Post by David Wang
System.out.println("before·");
JAXBContext context =
JAXBContext.newInstance("SomeXMLPackage");
Post by David Wang
System.out.println("after·");
and it fails on the JAXB statement above.
I then added Debug and AUTOSTUDY  option in perl like below
Post by David Wang
use Inline (
    Java => 'DATA',
    J2SDK =>
$ENV{JAVA_HOME},
Post by David Wang
    CLASSPATH =>
'classes',
Post by David Wang
    AUTOSTUDY => 1,
    DEBUG => 4,
);
then I see
[java][3]   packet sent is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
[perl][3]   packet recv is ok
java_object:1:1:javax.xml.bind.JAXBException
Post by David Wang
[perl][3]   checking if stub is
array...
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
[perl][2]  autostudying
javax.xml.bind.JAXBException...
Post by David Wang
[perl][3]   perl doesn't know
about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
Post by David Wang
[perl][3]   reporting on
javax.xml.bind.JAXBException
Post by David Wang
I hope perl inline works with JAXB . BTW,
my Java API works fine meaning I use a Java main to call this
Post by David Wang
API and the xml file is loaded without
problem.
Post by David Wang
thanks,
David
Post by David Wang
________________________________
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick
question
Post by David Wang
Yep, as a rule, if you need to install a
Perl module, a simple "cpan Module::Name" should do it. If
you are on a Unixish system, you may have installation permission
issues, in which case there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Post by David Wang
Post by David Wang
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David
Post by David Wang
Ok, I figured it out. Hope it can be documented
somewhere.
Post by David Wang
Post by David Wang
Download Inline-0.53
go to the dir
cpan Inline::Java  << was instructed by some
nice guy
Post by David Wang
Post by David Wang
Thanks
David
Post by David Wang
________________________________
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it
today. I looked around the web and I find the installation
Post by David Wang
Post by David Wang
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to
install inline::Java ? BTW, I found the latest Inline
is Inline-0.53.tar.gz  and I use Redhat 5
Post by David Wang
Post by David Wang
Thanks
David
--
 "Debugging is twice as hard as writing the code in the
first place.
Post by David Wang
Post by David Wang
  Therefore, if you write the code as cleverly as possible, you
are,
Post by David Wang
Post by David Wang
  by definition, not smart enough to debug it." -- Brian
Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Russ Tremain
2014-01-03 00:06:32 UTC
Permalink
Hi Patrick,

To add to the discussion, I ran a modified
version of JDBC.pm using DEBUG => 4 setting,
first under perl 5.8.9, and under perl 5.18.1

I also ran under perl 5.12.4 and got the same error as 5.18.1.

There is a bug report filed for JDBC.pm:
https://rt.cpan.org/Public/Bug/Display.html?id=50307
Also a note to perl-monks:
http://www.perlmonks.org/?node_id=505979 but it
is a different error.

It seems to initialize fine, but then aborts with
an error as Inline tries to match the first call
to jdbc.

Here are some diffs for the debug output
(truncated for clarity) - 5.18.1 on the left,
5.8.9 on the right:

[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver' ('main::o
[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver' ('main::o
[perl][2] creating object in java
(main::org::apache::derby::jdbc::EmbeddedDriver):
[perl][2] creating object in java
(main::org::apache::derby::jdbc::EmbeddedDriver):
sqlpj::sqlpjImpl::sql_init_connection[738]: eval
FAILED: Can't locate object method | [perl][3]
matching arguments to
getConnection(java.lang.String)

| [perl][3] error trying to fit args to
prototype: Wrong number of arguments at /usr
sqlpj::sqlpjImpl::sqlsession[254]: cannot get a
database connection: ABORT | [perl][3]
matching arguments to
getConnection(java.lang.String, java.lang.String,
[perl][1] killed by natural death.
| [perl][3] match successful: score is 6


the full error I get back from my eval is:

[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver'
('main::org::apache::derby::jdbc::EmbeddedDriver')
[perl][2] creating object in java
(main::org::apache::derby::jdbc::EmbeddedDriver):
sqlpj::sqlpjImpl::sql_init_connection[738]:
eval FAILED: Can't locate object method
"__validate_prototype" via package "JDBC" at
(eval 41) line 206, <GEN8> line 5.

sqlpj::sqlpjImpl::sqlsession[254]:
cannot get a database connection: ABORT
[perl][1] killed by natural death.
[perl][1] JVM owner exiting...

JDBC.pm is a pretty simple module that basically
just maps java.sql.* classes into the JDBC
namespace:

our @ISA = qw(Exporter java::sql::DriverManager);

{ # the Inline package needs to be use'd in main in order to
# get the studied classes to be rooted in main
package main;
use Inline ( Java => q{ }, AUTOSTUDY => 1, DEBUG => 4 );
}

use Inline::Java qw(cast caught study_classes);

our @EXPORT_OK = qw(cast caught study_classes);

our $debug = $ENV{PERL_JDBC_DEBUG} || 0;

#java.sql.ParameterMetaData
my @classes = (qw(
java.sql.Array
java.sql.BatchUpdateException
java.sql.Blob
java.sql.CallableStatement
...
));

warn "studying classes\n" if $debug;
study_classes(\@classes, 'main');

Any ideas? Possible it is something to do with a namespace mismatch?
Is __validate_prototype a symbol that is supposed
to be injected by Inline::Java?

-Russ

P.S. I can get the Inline::Java module tests to
pass as well, but not the JDBC tests.
P.P.S. Error is not peculiar to Derby db, it
happens with any driver I've tried.
Post by Patrick LeBoutillier
Hi,
I just ran the tests without issues on Fedora 17, Perl 5.14 and Java 1.7.0.
There's really not much in Inline::Java that is dependant on the perl version.
Patrick
On Mon, Dec 16, 2013 at 9:08 PM, Russ Tremain
Well, I'm using JDBC.pm to access the
inline::Java stuff, and I could never get it to
work with >5.8.9, and never got any response
from Tim Bunce or Patrick, so I eventually gave
up on it.
It is possible that JDBC is doing something
different, but I doubt it, as it is a very
simple module. It basically does a lot of
runtime "studying" in order to add all the
java.sql classes to main:: to make it easier to
call.
Best you can do is to write some tests and try the later environment.
I could not get the JDBC tests to run in a later
env, and the tests have been broken on CPAN
testers for a long time.
-Russ
Post by David Wang
Hi Russ
So I got the Inline:Java including JAXB to work
on my v5.8.8 perfectly . Then, I remember you
mentioned that you never got it/Java to work on
any Perl version later than 5.8.9 . Now, I am
starting to worry since my deploy machine uses
v5.10.0 . The Inline version I use is
Inline-0.53 . Can someone confirm if this will
or will not work on Perl version v5.10.0?
Thanks
David
Cc: David Mertens
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv1198785418 #yiv1198785418 -- blockquote,
#yiv1198785418 dl, #yiv1198785418 ul,
#yiv1198785418 ol, #yiv1198785418 li
{padding-top:0;padding-bottom:0;} #yiv1198785418
Re: New to Inline::Java and a quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
<https://github.com/russt/sqlpj>https://github.com/russt/sqlpj
best of luck!
-Russ
Post by David Wang
Thanks
I am not sure if anybody has any experience with
perl Inline::Java to call Java JAXB . Basically,
I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then
added Debug and AUTOSTUDY option in perl like
below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main to
call this
API and the xml file is loaded without problem.
thanks,
David
From: David Mertens
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may have
installation permission issues, in which case
there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web and
I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how
to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Patrick LeBoutillier
2014-01-05 03:02:15 UTC
Permalink
Russ,

With that info I was able to reproduce the problem:

[***@pc259 JDBC-0.01]$ perl -Mblib t/01-driver.t
1..4
CLASSPATH=/tmp/JDBC-0.01/drivers/db-derby-10.1.1.0.jar
ok 1 - driver class loaded
Can't locate object method "__validate_prototype" via package "JDBC" at
(eval 31) line 344, <GEN6> line 5.
# Looks like you planned 4 tests but ran 1.
# Looks like your test exited with 255 just after 1.

To answer your question, the __validate_prototype is part of the
Inline::Java::Object class, which JDBC derives via
java::sql::DriverManager.

Anyway, here's a quick patch to JDBC that fixes the problem:

--- JDBC.pm.ori 2014-01-04 21:55:24.845018833 -0500
+++ JDBC.pm 2014-01-04 21:55:49.782943330 -0500
@@ -43,8 +43,6 @@

=cut

-our @ISA = qw(Exporter java::sql::DriverManager);
-
{ # the Inline package needs to be use'd in main in order to
# get the studied classes to be rooted in main
package main;
@@ -106,6 +104,9 @@
warn "studying classes\n" if $debug;
study_classes(\@classes, 'main');

+
+our @ISA = qw(Exporter java::sql::DriverManager);
+
# Driver => java.sql.Driver, RowSet => javax.sql.RowSet etc
my %class_base = map { m/^(.*\.(\w+))$/ or die; ( $2 => $1) } @classes;

It seems like initialising the @ISA array later (once the Java methods are
loaded) fixes the problem.

After some poking around, I found that there was some changes in Perl 5.10
regarding multiple inheritance (see
http://perldoc.perl.org/perl5100delta.html). I believe something changed in
that release with the way some of
this stuff is handled. Just a theory...


Patrick
Post by Russ Tremain
Hi Patrick,
To add to the discussion, I ran a modified version of JDBC.pm using DEBUG
=> 4 setting, first under perl 5.8.9, and under perl 5.18.1
I also ran under perl 5.12.4 and got the same error as 5.18.1.
https://rt.cpan.org/Public/Bug/Display.html?id=50307
Also a note to perl-monks: http://www.perlmonks.org/?node_id=505979 but
it is a different error.
It seems to initialize fine, but then aborts with an error as Inline tries
to match the first call to jdbc.
Here are some diffs for the debug output (truncated for clarity) - 5.18.1
[perl][3] perl doesn't know about 'org.apache.derby.jdbc.EmbeddedDriver'
('main::o [perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver' ('main::o
[perl][2] creating object in java
(main::org::apache::derby::jdbc::EmbeddedDriver): [perl][2] creating
sqlpj::sqlpjImpl::sql_init_connection[738]: eval FAILED: Can't locate
object method | [perl][3] matching arguments to
getConnection(java.lang.String)
Wrong number of arguments at /usr
ABORT | [perl][3] matching arguments to
getConnection(java.lang.String, java.lang.String,
[perl][1] killed by natural death.
| [perl][3] match successful: score is 6
[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver'
('main::org::apache::derby::jdbc::EmbeddedDriver')
[perl][2] creating object in java
sqlpj::sqlpjImpl::sql_init_connection[738]: eval FAILED: Can't
locate object method "__validate_prototype" via package "JDBC" at (eval 41)
line 206, <GEN8> line 5.
sqlpj::sqlpjImpl::sqlsession[254]: cannot get a database
connection: ABORT
[perl][1] killed by natural death.
[perl][1] JVM owner exiting...
JDBC.pm is a pretty simple module that basically just maps java.sql.*
{ # the Inline package needs to be use'd in main in order to
# get the studied classes to be rooted in main
package main;
use Inline ( Java => q{ }, AUTOSTUDY => 1, DEBUG => 4 );
}
use Inline::Java qw(cast caught study_classes);
our $debug = $ENV{PERL_JDBC_DEBUG} || 0;
#java.sql.ParameterMetaData
java.sql.Array
java.sql.BatchUpdateException
java.sql.Blob
java.sql.CallableStatement
...
));
warn "studying classes\n" if $debug;
Any ideas? Possible it is something to do with a namespace mismatch?
Is __validate_prototype a symbol that is supposed to be injected by
Inline::Java?
-Russ
P.S. I can get the Inline::Java module tests to pass as well, but not the
JDBC tests.
P.P.S. Error is not peculiar to Derby db, it happens with any driver I've
tried.
Hi,
I just ran the tests without issues on Fedora 17, Perl 5.14 and Java 1.7.0.
There's really not much in Inline::Java that is dependant on the perl
version.
Patrick
Well, I'm using JDBC.pm to access the inline::Java stuff, and I could
never get it to work with >5.8.9, and never got any response from Tim Bunce
or Patrick, so I eventually gave up on it.
It is possible that JDBC is doing something different, but I doubt it, as
it is a very simple module. It basically does a lot of runtime "studying"
in order to add all the java.sql classes to main:: to make it easier to
call.
Best you can do is to write some tests and try the later environment.
I could not get the JDBC tests to run in a later env, and the tests have
been broken on CPAN testers for a long time.
-Russ
Hi Russ
So I got the Inline:Java including JAXB to work on my v5.8.8 perfectly .
Then, I remember you mentioned that you never got it/Java to work on any
Perl version later than 5.8.9 . Now, I am starting to worry since my deploy
machine uses v5.10.0 . The Inline version I use is Inline-0.53 . Can
someone confirm if this will or will not work on Perl version v5.10.0?
Thanks
David
------------------------------
*Sent:* Thursday, December 12, 2013 5:05 PM
*Subject:* Re: New to Inline::Java and a quick question
#yiv1198785418 #yiv1198785418 -- blockquote, #yiv1198785418 dl,
#yiv1198785418 ul, #yiv1198785418 ol, #yiv1198785418 li
{padding-top:0;padding-bottom:0;} #yiv1198785418 Re: New to Inline::Java
and a quick question
one thing I can tell you is I have never gotten Inline::Java to work with
any perl later than 5.8.9.
I have used it extensively with JDBC.pm. Example of this can be found
https://github.com/russt/sqlpj
best of luck!
-Russ
Thanks
I am not sure if anybody has any experience with perl Inline::Java to call
Java JAXB . Basically, I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then added Debug and AUTOSTUDY
option in perl like below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about 'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my Java API works fine meaning I
use a Java main to call this
API and the xml file is loaded without problem.
thanks,
David
------------------------------
*Sent:* Thursday, December 12, 2013 5:37 AM
*Subject:* Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl module, a simple "cpan
Module::Name" should do it. If you are on a Unixish system, you may have
installation permission issues, in which case there are known work-arounds.
But I'm sure you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
------------------------------
*Sent:* Wednesday, December 11, 2013 4:25 PM
*Subject:* New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to hear about it today. I looked
around the web and I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how to install inline::Java ?
BTW, I found the latest Inline is Inline-0.53.tar.gz and I use Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Russ Tremain
2014-01-05 16:47:38 UTC
Permalink
Awesome Patrick! My program is now working against 5.18.1...

% perl --version
This is perl 5, version 18, subversion 1
(v5.18.1) built for darwin-thread-multi-2level
...

% cat derbytestdb.props
JDBC_CLASSPATH=/Users/russt/proj/rttl/devtools/tl/src/cmn/sqlpj/regress/drivers/derby.jar
JDBC_DRIVER_CLASS=org.apache.derby.jdbc.EmbeddedDriver
JDBC_URL=jdbc:derby:testDB;create=true
JDBC_USER=test
JDBC_PASSWORD=test

% sqlpj -props derbytestdb.props
studying classes
running
derbydb> show conn
getURL() jdbc:derby:testDB
getUserName() test
getDriverName()
Apache Derby Embedded JDBC Driver
getDriverVersion() 10.9.1.0 - (1344872)
getDatabaseProductName() Apache Derby
getDatabaseProductVersion() 10.9.1.0 - (1344872)

Based on this comment re: the "mro" pragma introduced in perl 5.10.0:

Also, the cache *::ISA::CACHE:: no longer
exists; to force reset the @ISA cache,
you now need to use the mro API, or more
simply to assign to @ISA (e.g. with @ISA = @ISA ).

I tried this alternate fix and it works as well
(tested against 5.8.9 and 5.18.1):

$ diff -c JDBC.pm.installed lib/myJDBC.pm
*** JDBC.pm.installed 2014-01-05 08:04:52.000000000 -0800
--- lib/myJDBC.pm 2014-01-05 08:05:14.000000000 -0800
***************
*** 106,111 ****
--- 106,113 ----
warn "studying classes\n" if $debug;
study_classes(\@classes, 'main');

+ @ISA = @ISA;
+
# Driver => java.sql.Driver, RowSet => javax.sql.RowSet etc
my %class_base = map { m/^(.*\.(\w+))$/ or die; ( $2 => $1) } @classes;

Tim, any chance of getting a cpan update with a patch for JDBC.pm?

This would allow bug
https://rt.cpan.org/Public/Bug/Display.html?id=50307
to be closed.

Patrick, might be worth a usage note for Inline::Java.
The obscurity of this problem could make such a note quite valuable.

best,
-Russ
Post by Patrick LeBoutillier
Russ,
1..4
CLASSPATH=/tmp/JDBC-0.01/drivers/db-derby-10.1.1.0.jar
ok 1 - driver class loaded
Can't locate object method
"__validate_prototype" via package "JDBC" at
(eval 31) line 344, <GEN6> line 5.
# Looks like you planned 4 tests but ran 1.
# Looks like your test exited with 255 just after 1.
To answer your question, the
__validate_prototype is part of the
Inline::Java::Object class, which JDBC derives
via
java::sql::DriverManager.
--- JDBC.pm.ori 2014-01-04 21:55:24.845018833 -0500
+++ JDBC.pm 2014-01-04 21:55:49.782943330 -0500
@@ -43,8 +43,6 @@
=cut
-
{ # the Inline package needs to be use'd in main in order to
# get the studied classes to be rooted in main
package main;
@@ -106,6 +104,9 @@
warn "studying classes\n" if $debug;
+
+
# Driver => java.sql.Driver, RowSet => javax.sql.RowSet etc
(once the Java methods are loaded) fixes the
problem.
After some poking around, I found that there was
some changes in Perl 5.10 regarding multiple
inheritance (see
<http://perldoc.perl.org/perl5100delta.html>http://perldoc.perl.org/perl5100delta.html).
I believe something changed in that release with
the way some of
this stuff is handled. Just a theory...
Patrick
On Thu, Jan 2, 2014 at 7:06 PM, Russ Tremain
Hi Patrick,
To add to the discussion, I ran a modified
version of JDBC.pm using DEBUG => 4 setting,
first under perl 5.8.9, and under perl 5.18.1
I also ran under perl 5.12.4 and got the same error as 5.18.1.
<https://rt.cpan.org/Public/Bug/Display.html?id=50307>https://rt.cpan.org/Public/Bug/Display.html?id=50307
<http://www.perlmonks.org/?node_id=505979>http://www.perlmonks.org/?node_id=505979
but it is a different error.
It seems to initialize fine, but then aborts
with an error as Inline tries to match the first
call to jdbc.
Here are some diffs for the debug output
(truncated for clarity) - 5.18.1 on the left,
[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver' ('main::o
[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver' ('main::o
[perl][2] creating object in java
[perl][2] creating object in java
sqlpj::sqlpjImpl::sql_init_connection[738]: eval
FAILED: Can't locate object method | [perl][3]
matching arguments to
getConnection(java.lang.String)
| [perl][3] error trying to fit args to
prototype: Wrong number of arguments at /usr
sqlpj::sqlpjImpl::sqlsession[254]: cannot get a
database connection: ABORT | [perl][3]
matching arguments to
getConnection(java.lang.String, java.lang.String,
[perl][1] killed by natural death.
| [perl][3] match successful: score is 6
[perl][3] perl doesn't know about
'org.apache.derby.jdbc.EmbeddedDriver'
('main::org::apache::derby::jdbc::EmbeddedDriver')
[perl][2] creating object in java
sqlpj::sqlpjImpl::sql_init_connection[738]: eval
FAILED: Can't locate object method
"__validate_prototype" via package "JDBC" at
(eval 41) line 206, <GEN8> line 5.
sqlpj::sqlpjImpl::sqlsession[254]: cannot
get a database connection: ABORT
[perl][1] killed by natural death.
[perl][1] JVM owner exiting...
JDBC.pm is a pretty simple module that basically
just maps java.sql.* classes into the JDBC
{ # the Inline package needs to be use'd in main in order to
# get the studied classes to be rooted in main
package main;
use Inline ( Java => q{ }, AUTOSTUDY => 1, DEBUG => 4 );
}
use Inline::Java qw(cast caught study_classes);
our $debug = $ENV{PERL_JDBC_DEBUG} || 0;
#java.sql.ParameterMetaData
java.sql.Array
java.sql.BatchUpdateException
java.sql.Blob
java.sql.CallableStatement
...
));
warn "studying classes\n" if $debug;
Any ideas? Possible it is something to do with a namespace mismatch?
Is __validate_prototype a symbol that is
supposed to be injected by Inline::Java?
-Russ
P.S. I can get the Inline::Java module tests to
pass as well, but not the JDBC tests.
P.P.S. Error is not peculiar to Derby db, it
happens with any driver I've tried.
Post by Patrick LeBoutillier
Hi,
I just ran the tests without issues on Fedora 17, Perl 5.14 and Java 1.7.0.
There's really not much in Inline::Java that is dependant on the perl version.
Patrick
On Mon, Dec 16, 2013 at 9:08 PM, Russ Tremain
Well, I'm using JDBC.pm to access the
inline::Java stuff, and I could never get it to
work with >5.8.9, and never got any response
from Tim Bunce or Patrick, so I eventually gave
up on it.
It is possible that JDBC is doing something
different, but I doubt it, as it is a very
simple module. It basically does a lot of
runtime "studying" in order to add all the
java.sql classes to main:: to make it easier to
call.
Best you can do is to write some tests and try the later environment.
I could not get the JDBC tests to run in a later
env, and the tests have been broken on CPAN
testers for a long time.
-Russ
Post by Patrick LeBoutillier
Hi Russ
So I got the Inline:Java including JAXB to work
on my v5.8.8 perfectly . Then, I remember you
mentioned that you never got it/Java to work on
any Perl version later than 5.8.9 . Now, I am
starting to worry since my deploy machine uses
v5.10.0 . The Inline version I use is
Inline-0.53 . Can someone confirm if this will
or will not work on Perl version v5.10.0?
Thanks
David
Cc: David Mertens
Sent: Thursday, December 12, 2013 5:05 PM
Subject: Re: New to Inline::Java and a quick question
#yiv1198785418 #yiv1198785418 -- blockquote,
#yiv1198785418 dl, #yiv1198785418 ul,
#yiv1198785418 ol, #yiv1198785418 li
{padding-top:0;padding-bottom:0;} #yiv1198785418
Re: New to Inline::Java and a quick question
one thing I can tell you is I have never gotten
Inline::Java to work with any perl later than
5.8.9.
<https://github.com/russt/sqlpj>https://github.com/russt/sqlpj
best of luck!
-Russ
Post by Patrick LeBoutillier
Thanks
I am not sure if anybody has any experience with
perl Inline::Java to call Java JAXB . Basically,
I have added some code in my perl script to call
some of my Java API that calls JAXB.
System.out.println("before·");
JAXBContext context = JAXBContext.newInstance("SomeXMLPackage");
System.out.println("after·");
and it fails on the JAXB statement above. I then
added Debug and AUTOSTUDY option in perl like
below
use Inline (
Java => 'DATA',
J2SDK => $ENV{JAVA_HOME},
CLASSPATH => 'classes',
AUTOSTUDY => 1,
DEBUG => 4,
);
then I see
[java][3] packet sent is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] packet recv is ok java_object:1:1:javax.xml.bind.JAXBException
[perl][3] checking if stub is array...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][2] autostudying javax.xml.bind.JAXBException...
[perl][3] perl doesn't know about
'javax.xml.bind.JAXBException'
('perlAPI::javax::xml::bind::JAXBException')
[perl][3] reporting on javax.xml.bind.JAXBException
I hope perl inline works with JAXB . BTW, my
Java API works fine meaning I use a Java main to
call this
API and the xml file is loaded without problem.
thanks,
David
From: David Mertens
Sent: Thursday, December 12, 2013 5:37 AM
Subject: Re: New to Inline::Java and a quick question
Yep, as a rule, if you need to install a Perl
module, a simple "cpan Module::Name" should do
it. If you are on a Unixish system, you may have
installation permission issues, in which case
there are known work-arounds. But I'm sure
you'll ask when you come to those. :-)
Good luck, and don't be afraid to ask more questions as they come up!
David
On Wed, Dec 11, 2013 at 7:38 PM, David Wang
Ok, I figured it out. Hope it can be documented somewhere.
Download Inline-0.53
go to the dir
cpan Inline::Java << was instructed by some nice guy
Thanks
David
Sent: Wednesday, December 11, 2013 4:25 PM
Subject: New to Inline::Java and a quick question
Hi
I am very new to this stuff, just started to
hear about it today. I looked around the web and
I find the installation
instructions for inline::c like the following
perl Makefile.PL;
make;
make test;
make install;
But I can't find anywhere else that tells us how
to install inline::Java ? BTW, I found the
latest Inline is Inline-0.53.tar.gz and I use
Redhat 5
Thanks
David
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
--
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada
Loading...