javaserver-perl Mailing List for JavaServer
Brought to you by:
zzo
You can subscribe to this list here.
2004 |
Jan
(4) |
Feb
(10) |
Mar
(10) |
Apr
(3) |
May
(1) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(7) |
Nov
(4) |
Dec
|
---|
From: <ma...@zz...> - 2004-11-18 04:02:49
|
Sorry you are correct - you need to start is using 'com.zzo.javaserver.JavaServer' ... Great- what was it out of curiousity? Also please joing the mailing list for this project - you can sign up at http://www.sourceforge.net/projects/javaserver & joing javaserver-perl or whichever lists interest you. That way other people can benefit from the discussion - thanks! Mark On Wed, Nov 17, 2004 at 07:24:26PM -0800, Tomas Jansson wrote: > Yippii... It's working. But have one more question: > I can't get the JavaServer starting with the command you sent to me earlier, > % java -cp > .:/path/to/TestJava.class/directory:/path/to/JavaServer.jar JavaServer > > What I did was, > % java -cp > .:/path/to/TestJava.class/directory:/path/to/JavaServer.jar > com.zzo.javaserver.JavaServer > > Should I be able to do it as in the first example? > > Thanks a lot for getting things working:) > > --Tomas > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Wednesday, November 17, 2004 7:05 PM > To: Tomas Jansson > Cc: jav...@li... > Subject: Re: Java.pm question > > > I assume your TestJava.java class has a public no-arg constructor? > Also try using: > % java -cp .:/path/to/TestJava.class/directory:/path/to/JavaServer.jar > JavaServer > > maybe you spelled CLASSPATH wrong or it's not picking it up from your > environment... > Mark > > On Wed, Nov 17, 2004 at 06:56:53PM -0800, Tomas Jansson wrote: > > Forgot to update the result I got when I tried it with your suggestiong. > Got > > the same message when setting my classpath to /my/dir/TestJava.class > > > > --Tomas > > > > -----Original Message----- > > From: ma...@zz... [mailto:ma...@zz...] > > Sent: Wednesday, November 17, 2004 6:14 PM > > To: Tomas Jansson > > Cc: jav...@li... > > Subject: Re: Java.pm question > > > > > > Hey Tomas, > > Try setting your classpath to /my/dir/TestJava.class > > I assume your TestJava object is not in a package itself. > > Show me the exact command you're using to start JavaServer. > > Also what exactly is happening when you try to create the TestJava > > class - what Exception are you getting? > > thanks, > > Mark > > > > On Wed, Nov 17, 2004 at 05:40:49PM -0800, Tomas Jansson wrote: > > > Hi Mark, > > > I sitting here and trying to use your module but can't figure out how to > > > create my own object. All the example that I can find (only those on > cpan) > > > include standard objects from java.lang. What I am trying to do is > > basically > > > this: > > > > > > Have a class called TestJava.class in /my/dir/ > > > I also have a script, javatest.pl, in /my/dir > > > In javatest.pl I want to create a TestJava object. I tried: > > > my $java = new Java > > > my $obj = $java->create_object("TestJava"); > > > but it doesn't work. I have got it to work with standard classes. My > > > classpath in the console where I try to run the perl script is > > > "/path/to/JavaServer.jar:/my/dir" > > > > > > Thanks, > > > Tomas |
From: <ma...@zz...> - 2004-11-18 03:04:31
|
I assume your TestJava.java class has a public no-arg constructor? Also try using: % java -cp .:/path/to/TestJava.class/directory:/path/to/JavaServer.jar JavaServer maybe you spelled CLASSPATH wrong or it's not picking it up from your environment... Mark On Wed, Nov 17, 2004 at 06:56:53PM -0800, Tomas Jansson wrote: > Forgot to update the result I got when I tried it with your suggestiong. Got > the same message when setting my classpath to /my/dir/TestJava.class > > --Tomas > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Wednesday, November 17, 2004 6:14 PM > To: Tomas Jansson > Cc: jav...@li... > Subject: Re: Java.pm question > > > Hey Tomas, > Try setting your classpath to /my/dir/TestJava.class > I assume your TestJava object is not in a package itself. > Show me the exact command you're using to start JavaServer. > Also what exactly is happening when you try to create the TestJava > class - what Exception are you getting? > thanks, > Mark > > On Wed, Nov 17, 2004 at 05:40:49PM -0800, Tomas Jansson wrote: > > Hi Mark, > > I sitting here and trying to use your module but can't figure out how to > > create my own object. All the example that I can find (only those on cpan) > > include standard objects from java.lang. What I am trying to do is > basically > > this: > > > > Have a class called TestJava.class in /my/dir/ > > I also have a script, javatest.pl, in /my/dir > > In javatest.pl I want to create a TestJava object. I tried: > > my $java = new Java > > my $obj = $java->create_object("TestJava"); > > but it doesn't work. I have got it to work with standard classes. My > > classpath in the console where I try to run the perl script is > > "/path/to/JavaServer.jar:/my/dir" > > > > Thanks, > > Tomas |
From: <ma...@zz...> - 2004-11-18 02:13:32
|
Hey Tomas, Try setting your classpath to /my/dir/TestJava.class I assume your TestJava object is not in a package itself. Show me the exact command you're using to start JavaServer. Also what exactly is happening when you try to create the TestJava class - what Exception are you getting? thanks, Mark On Wed, Nov 17, 2004 at 05:40:49PM -0800, Tomas Jansson wrote: > Hi Mark, > I sitting here and trying to use your module but can't figure out how to > create my own object. All the example that I can find (only those on cpan) > include standard objects from java.lang. What I am trying to do is basically > this: > > Have a class called TestJava.class in /my/dir/ > I also have a script, javatest.pl, in /my/dir > In javatest.pl I want to create a TestJava object. I tried: > my $java = new Java > my $obj = $java->create_object("TestJava"); > but it doesn't work. I have got it to work with standard classes. My > classpath in the console where I try to run the perl script is > "/path/to/JavaServer.jar:/my/dir" > > Thanks, > Tomas |
From: <ma...@zz...> - 2004-11-17 00:00:14
|
Yes it's true there's now a C client for JavaServer allowing you do to all the fun Java programming you were doing in Perl in C. Create/delete objects, call their functions, get & set fields, handle events, & event throw & catch Exceptions - yikes! JNI is ugly, libjava is not. Check out http://www.zzo.com/Java/getit.html for more gory details on the new libjava C library. Enjoy, Mark |
From: Mark E. T. <ma...@zz...> - 2004-10-29 22:15:28
|
Cool. JavaServer will attempt to instantiate a new class every time - unless pooling is implemented in the underlying class a new one will be created. You probably want a pooling mechanism for this kind of thing as JavaServer does not provide one... Mark > I found the problem, and indeed it's not in the JavaServer code! > > Using perl alarms helped me to isolate what was hanging. Regarding the > large # of threads, closing the Oracle connection really helped! > > > I have a quick question regarding JavaServer. > > In one of my Java classes being created, I am using an Oracle JDBC > client via a non-static Oracle connection instance variable. > > In subsequent class creations of the same class, is the object being > newly instantiated or is there a pooled object being reused? > Additionally, do I need to implement any synchronization methods around > methods that make use of the connection for example? > > Thanks very much again. > > > Jordan > > > > -----Original Message----- > From: jav...@li... > [mailto:jav...@li...] On Behalf Of > ma...@zz... > Sent: Thursday, October 14, 2004 10:08 AM > To: Jordan Redner > Cc: jav...@li... > Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) > call > > Wow that's a lotta threads in not so much memory. Yah try to socket > timeout but a more fundamental problem is JavaServer hanging - prolly > running out of memory - look a 'top' next time that happens & see what > the Java process is doing... > M > > On Thu, Oct 14, 2004 at 09:48:24AM -0700, Jordan Redner wrote: >> It's hard to reproduce. It seems to happen when the machine is under >> high CPU load. >> >> The JavaServer typically does have a lot of threads and does run for >> long periods of time. I just checked a production machine and there > are >> 133 threads (ps -ef on Linux) total memory is 151 MB. >> >> Thinking about putting a socket timeout in Java.pm... even though it's >> running on localhost, what do you think? >> >> >> >> Jordan >> >> >> -----Original Message----- >> From: ma...@zz... [mailto:ma...@zz...] >> Sent: Thursday, October 14, 2004 8:29 AM >> To: Jordan Redner >> Cc: jav...@li... >> Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) >> call >> >> Can you telnet to 127.0.0.1 port 2000? >> Then try: >> >> #!perl >> >> use IO::Socket; >> my $socket = IO::Socket::INET->new >> ( >> PeerAddr => '127.0.0.1', >> PeerPort => 2000, >> ); >> >> & see if that hangs. >> Does it hang all of the time or only sometimes? Maybe it's the >> JavaServer >> process itself that's hanging. Hm. If only sometimes is it after >> JavaServer >> has been running for a while w/lots of objects? >> I don't think upgrading to 4.7 will help - it's better handling for > Java >> protected fields. >> M >> >> >> On Thu, Oct 14, 2004 at 08:03:30AM -0700, Jordan Redner wrote: >> > Thanks so much for the fast response. >> > >> > Server port is always 127.0.0.1 >> > >> > OS is a couple years old. >> > >> > Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 > 17:34:59 >> > CEST 2002 i686 >> > >> > Perl version 5.8.0 >> > >> > >> > >> > Do you think upgrading from 4.6 to 4.7 will help? Are there any >> > synchronization issues which were fixed or anything like that? When > I >> > read "better handling of private/protected fields/functions...", I >> > wasn't sure of what this meant internally. JavaServer runs on > several >> > production machines, otherwise I'd just go ahead and try it. >> > >> > My next step is to install a timeout parm. in the socket constructor >> > inside Java.pm. What are your thoughts on this?? >> > >> > >> > Thanks for your help. >> > >> > >> > >> > Jordan >> > >> > >> > -----Original Message----- >> > From: ma...@zz... [mailto:ma...@zz...] >> > Sent: Wednesday, October 13, 2004 9:33 PM >> > To: Jordan Redner >> > Cc: jav...@li... >> > Subject: Re: Perl process hangs on new Java(...) call >> > >> > The only interesting thing the Java.pm constructor does that may > cause >> > it to hang is trying to connect to the remove JavaServer java > process. >> > Try to telnet to port 2000 of your JavaServer machine from the > machine >> > running the perl code to ensure you can make a connection between > the >> > two. >> > Of course you'll want to make sure you're running compatible version >> > of Java.pm & JavaServer (the major version numbers match). >> > Perhaps your DNS is screwey & your JavaServer host is not be > resolved? >> > As to why it stays hung - which operating system are you running on? >> > If perl is 'hung' in a system call (socket connect) perhaps the >> > signal never gets sent. >> > Lemmie know how it goes - we'll get it figured out. >> > Mark >> > >> > PS there is a mailing list at sourceforge that you should join (very >> low >> > traffic) for questions such as these: >> > http://lists.sourceforge.net/lists/listinfo/javaserver-perl >> > >> > >> > On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: >> > > Hi, I hope you can help. I'm using your product as a way to > migrate >> > > some code from Perl to Java so it's a pretty key piece to our >> > strategy. >> > > >> > > >> > > >> > > >> > > Even though we put in alarms, we still end up with hung perl >> > processes. >> > > The processes seem to be hung on the line below that is bold, or >> when >> > it >> > > calls out to >> > > >> > > $java = new Java(host => $perlJavaHost, >> > > >> > > port => $perlJavaPort, >> > > >> > > event_port => -1, >> > > >> > > use_tied_arrays => 1 >> > > >> > > ); >> > > >> > > >> > > >> > > Do you have any idea what we can do to solve this problem? Was > this >> a >> > > known problem. The javaServer itself is very stable. This is the >> > only >> > > problem we know about. Is there a way to specify a timeout in the >> > > connection request? >> > > >> > > >> > > >> > > Thanks so much in advance for any help you can provide. >> > > >> > > >> > > >> > > >> > > >> > > sub getJava { >> > > >> > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) > >> @_; >> > > >> > > >> > > >> > > my $java; >> > > >> > > >> > > >> > > my $retries = 0; >> > > >> > > >> > > >> > > while ($retries < 2) { >> > > >> > > >> > > >> > > $retries ++; >> > > >> > > >> > > >> > > ## -- reset the timer for timeout before the eval > block >> > > >> > > alarm 0; >> > > >> > > >> > > >> > > eval { >> > > >> > > local $SIG{ALRM} = sub { >> > > >> > > ## -- Signal handler to catch the ALRM signal >> > > >> > > ## -- log the timeout error and continue next >> > iteration >> > > >> > > lib::perl::Infra::Log::Print("-- Timedout on the >> > > JavaServer trying to get a Java object instance --"); >> > > >> > > next; >> > > >> > > }; >> > > >> > > >> > > >> > > lib::perl::Infra::Log::Print("-- Setting JavaServer >> alarm >> > > to: $timeout --"); >> > > >> > > >> > > >> > > alarm $timeout; >> > > >> > > >> > > >> > > $java = new Java(host => $perlJavaHost, >> > > >> > > port => $perlJavaPort, >> > > >> > > event_port => -1, >> > > >> > > use_tied_arrays => 1 >> > > >> > > ); >> > > >> > > >> > > >> > > lib::perl::Infra::Log::Print("-- Successfully obtained > a >> > > Java object --"); >> > > >> > > >> > > >> > > ## -- reset the timer for timeout >> > > >> > > alarm 0; >> > > >> > > }; >> > > >> > > >> > > >> > > if (defined $java) { >> > > >> > > return $java; >> > > >> > > } else { >> > > >> > > my $err = ""; >> > > >> > > if ($@) { $err = $@; } >> > > >> > > >> > > >> > > if ($main::gLogger){ >> > > >> > > $err = "JavaUtil.pm" . "," . "Failed obtaining Java >> > object, >> > > retry count=$retries " . "\n$err"; >> > > >> > > $main::gLogger->Log("ERROR",$err); >> > > >> > > } else { >> > > >> > > $err = "Failed obtaining Java object, retry >> count=$retries >> > " >> > > . "\n$err"; >> > > >> > > lib::perl::Infra::Log::Print ($err); >> > > >> > > } >> > > >> > > >> > > >> > > restartJavaServer($javaServerRunner); >> > > >> > > sleep 5; >> > > >> > > } >> > > >> > > } >> > > >> > > >> > > >> > > return(undef); >> > > >> > > >> > > >> > > } >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > Jordan >> > > >> > > >> > > >> > >> > >> > >> > ------------------------------------------------------- >> > This SF.net email is sponsored by: IT Product Guide on >> ITManagersJournal >> > Use IT products in your business? Tell us what you think of them. > Give >> us >> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find > out >> more >> > http://productguide.itmanagersjournal.com/guidepromo.tmpl >> > _______________________________________________ >> > Javaserver-perl mailing list >> > Jav...@li... >> > https://lists.sourceforge.net/lists/listinfo/javaserver-perl >> > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give > us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_idU88&alloc_id065&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > |
From: Jordan R. <jr...@sh...> - 2004-10-29 19:25:37
|
I found the problem, and indeed it's not in the JavaServer code! Using perl alarms helped me to isolate what was hanging. Regarding the large # of threads, closing the Oracle connection really helped! =20 I have a quick question regarding JavaServer. In one of my Java classes being created, I am using an Oracle JDBC client via a non-static Oracle connection instance variable. In subsequent class creations of the same class, is the object being newly instantiated or is there a pooled object being reused? Additionally, do I need to implement any synchronization methods around methods that make use of the connection for example? Thanks very much again. =20 Jordan -----Original Message----- From: jav...@li... [mailto:jav...@li...] On Behalf Of ma...@zz... Sent: Thursday, October 14, 2004 10:08 AM To: Jordan Redner Cc: jav...@li... Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) call Wow that's a lotta threads in not so much memory. Yah try to socket timeout but a more fundamental problem is JavaServer hanging - prolly running out of memory - look a 'top' next time that happens & see what the Java process is doing... M On Thu, Oct 14, 2004 at 09:48:24AM -0700, Jordan Redner wrote: > It's hard to reproduce. It seems to happen when the machine is under > high CPU load. =20 >=20 > The JavaServer typically does have a lot of threads and does run for > long periods of time. I just checked a production machine and there are > 133 threads (ps -ef on Linux) total memory is 151 MB. >=20 > Thinking about putting a socket timeout in Java.pm... even though it's > running on localhost, what do you think? >=20 >=20 >=20 > Jordan >=20 >=20 > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...]=20 > Sent: Thursday, October 14, 2004 8:29 AM > To: Jordan Redner > Cc: jav...@li... > Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) > call >=20 > Can you telnet to 127.0.0.1 port 2000? > Then try: >=20 > #!perl >=20 > use IO::Socket; > my $socket =3D IO::Socket::INET->new > ( > PeerAddr =3D> '127.0.0.1', > PeerPort =3D> 2000, > ); >=20 > & see if that hangs. > Does it hang all of the time or only sometimes? Maybe it's the > JavaServer > process itself that's hanging. Hm. If only sometimes is it after > JavaServer > has been running for a while w/lots of objects? > I don't think upgrading to 4.7 will help - it's better handling for Java > protected fields. > M >=20 >=20 > On Thu, Oct 14, 2004 at 08:03:30AM -0700, Jordan Redner wrote: > > Thanks so much for the fast response.=20 > >=20 > > Server port is always 127.0.0.1 > >=20 > > OS is a couple years old. > >=20 > > Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 17:34:59 > > CEST 2002 i686=20 > >=20 > > Perl version 5.8.0 > >=20 > >=20 > >=20 > > Do you think upgrading from 4.6 to 4.7 will help? Are there any > > synchronization issues which were fixed or anything like that? When I > > read "better handling of private/protected fields/functions...", I > > wasn't sure of what this meant internally. JavaServer runs on several > > production machines, otherwise I'd just go ahead and try it. =20 > >=20 > > My next step is to install a timeout parm. in the socket constructor > > inside Java.pm. What are your thoughts on this?? > >=20 > >=20 > > Thanks for your help. > >=20 > >=20 > >=20 > > Jordan > >=20 > >=20 > > -----Original Message----- > > From: ma...@zz... [mailto:ma...@zz...]=20 > > Sent: Wednesday, October 13, 2004 9:33 PM > > To: Jordan Redner > > Cc: jav...@li... > > Subject: Re: Perl process hangs on new Java(...) call > >=20 > > The only interesting thing the Java.pm constructor does that may cause > > it to hang is trying to connect to the remove JavaServer java process. > > Try to telnet to port 2000 of your JavaServer machine from the machine > > running the perl code to ensure you can make a connection between the > > two. > > Of course you'll want to make sure you're running compatible version > > of Java.pm & JavaServer (the major version numbers match). > > Perhaps your DNS is screwey & your JavaServer host is not be resolved? > > As to why it stays hung - which operating system are you running on? > > If perl is 'hung' in a system call (socket connect) perhaps the > > signal never gets sent. > > Lemmie know how it goes - we'll get it figured out. > > Mark > >=20 > > PS there is a mailing list at sourceforge that you should join (very > low > > traffic) for questions such as these: > > http://lists.sourceforge.net/lists/listinfo/javaserver-perl > >=20 > >=20 > > On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > > > Hi, I hope you can help. I'm using your product as a way to migrate > > > some code from Perl to Java so it's a pretty key piece to our > > strategy. > > >=20 > > >=20 > > > =20 > > >=20 > > > Even though we put in alarms, we still end up with hung perl > > processes. > > > The processes seem to be hung on the line below that is bold, or > when > > it > > > calls out to=20 > > >=20 > > > $java =3D new Java(host =3D> $perlJavaHost, > > >=20 > > > port =3D> $perlJavaPort, > > >=20 > > > event_port =3D> -1, > > >=20 > > > use_tied_arrays =3D> 1 > > >=20 > > > ); > > >=20 > > > =20 > > >=20 > > > Do you have any idea what we can do to solve this problem? Was this > a > > > known problem. The javaServer itself is very stable. This is the > > only > > > problem we know about. Is there a way to specify a timeout in the > > > connection request? > > >=20 > > > =20 > > >=20 > > > Thanks so much in advance for any help you can provide. > > >=20 > > > =20 > > >=20 > > > =20 > > >=20 > > > sub getJava { > > >=20 > > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) = =3D > @_; > > >=20 > > > =20 > > >=20 > > > my $java; > > >=20 > > > =20 > > >=20 > > > my $retries =3D 0; > > >=20 > > > =20 > > >=20 > > > while ($retries < 2) { > > >=20 > > > =20 > > >=20 > > > $retries ++; > > >=20 > > > =20 > > >=20 > > > ## -- reset the timer for timeout before the eval block > > >=20 > > > alarm 0; > > >=20 > > > =20 > > >=20 > > > eval {=20 > > >=20 > > > local $SIG{ALRM} =3D sub { > > >=20 > > > ## -- Signal handler to catch the ALRM signal > > >=20 > > > ## -- log the timeout error and continue next > > iteration > > >=20 > > > lib::perl::Infra::Log::Print("-- Timedout on the > > > JavaServer trying to get a Java object instance --"); > > >=20 > > > next; > > >=20 > > > }; > > >=20 > > > =20 > > >=20 > > > lib::perl::Infra::Log::Print("-- Setting JavaServer > alarm > > > to: $timeout --"); > > >=20 > > > =20 > > >=20 > > > alarm $timeout; > > >=20 > > > =20 > > >=20 > > > $java =3D new Java(host =3D> $perlJavaHost, > > >=20 > > > port =3D> $perlJavaPort, > > >=20 > > > event_port =3D> -1, > > >=20 > > > use_tied_arrays =3D> 1 > > >=20 > > > ); > > >=20 > > > =20 > > >=20 > > > lib::perl::Infra::Log::Print("-- Successfully obtained a > > > Java object --"); > > >=20 > > > =20 > > >=20 > > > ## -- reset the timer for timeout > > >=20 > > > alarm 0; > > >=20 > > > }; > > >=20 > > > =20 > > >=20 > > > if (defined $java) { > > >=20 > > > return $java; > > >=20 > > > } else { > > >=20 > > > my $err =3D ""; > > >=20 > > > if ($@) { $err =3D $@; } > > >=20 > > > =20 > > >=20 > > > if ($main::gLogger){ > > >=20 > > > $err =3D "JavaUtil.pm" . "," . "Failed obtaining Java > > object, > > > retry count=3D$retries " . "\n$err"; > > >=20 > > > $main::gLogger->Log("ERROR",$err); > > >=20 > > > } else { > > >=20 > > > $err =3D "Failed obtaining Java object, retry > count=3D$retries > > " > > > . "\n$err"; > > >=20 > > > lib::perl::Infra::Log::Print ($err); > > >=20 > > > } > > >=20 > > > =20 > > >=20 > > > restartJavaServer($javaServerRunner); > > >=20 > > > sleep 5; > > >=20 > > > } > > >=20 > > > } > > >=20 > > > =20 > > >=20 > > > return(undef); > > >=20 > > > =20 > > >=20 > > > } > > >=20 > > > =20 > > >=20 > > > =20 > > >=20 > > > =20 > > >=20 > > > Jordan > > >=20 > > > =20 > > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product Guide on > ITManagersJournal > > Use IT products in your business? Tell us what you think of them. Give > us > > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > > http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > Javaserver-perl mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javaserver-perl >=20 ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Javaserver-perl mailing list Jav...@li... https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-10-14 17:03:55
|
Wow that's a lotta threads in not so much memory. Yah try to socket timeout but a more fundamental problem is JavaServer hanging - prolly running out of memory - look a 'top' next time that happens & see what the Java process is doing... M On Thu, Oct 14, 2004 at 09:48:24AM -0700, Jordan Redner wrote: > It's hard to reproduce. It seems to happen when the machine is under > high CPU load. > > The JavaServer typically does have a lot of threads and does run for > long periods of time. I just checked a production machine and there are > 133 threads (ps -ef on Linux) total memory is 151 MB. > > Thinking about putting a socket timeout in Java.pm... even though it's > running on localhost, what do you think? > > > > Jordan > > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Thursday, October 14, 2004 8:29 AM > To: Jordan Redner > Cc: jav...@li... > Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) > call > > Can you telnet to 127.0.0.1 port 2000? > Then try: > > #!perl > > use IO::Socket; > my $socket = IO::Socket::INET->new > ( > PeerAddr => '127.0.0.1', > PeerPort => 2000, > ); > > & see if that hangs. > Does it hang all of the time or only sometimes? Maybe it's the > JavaServer > process itself that's hanging. Hm. If only sometimes is it after > JavaServer > has been running for a while w/lots of objects? > I don't think upgrading to 4.7 will help - it's better handling for Java > protected fields. > M > > > On Thu, Oct 14, 2004 at 08:03:30AM -0700, Jordan Redner wrote: > > Thanks so much for the fast response. > > > > Server port is always 127.0.0.1 > > > > OS is a couple years old. > > > > Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 17:34:59 > > CEST 2002 i686 > > > > Perl version 5.8.0 > > > > > > > > Do you think upgrading from 4.6 to 4.7 will help? Are there any > > synchronization issues which were fixed or anything like that? When I > > read "better handling of private/protected fields/functions...", I > > wasn't sure of what this meant internally. JavaServer runs on several > > production machines, otherwise I'd just go ahead and try it. > > > > My next step is to install a timeout parm. in the socket constructor > > inside Java.pm. What are your thoughts on this?? > > > > > > Thanks for your help. > > > > > > > > Jordan > > > > > > -----Original Message----- > > From: ma...@zz... [mailto:ma...@zz...] > > Sent: Wednesday, October 13, 2004 9:33 PM > > To: Jordan Redner > > Cc: jav...@li... > > Subject: Re: Perl process hangs on new Java(...) call > > > > The only interesting thing the Java.pm constructor does that may cause > > it to hang is trying to connect to the remove JavaServer java process. > > Try to telnet to port 2000 of your JavaServer machine from the machine > > running the perl code to ensure you can make a connection between the > > two. > > Of course you'll want to make sure you're running compatible version > > of Java.pm & JavaServer (the major version numbers match). > > Perhaps your DNS is screwey & your JavaServer host is not be resolved? > > As to why it stays hung - which operating system are you running on? > > If perl is 'hung' in a system call (socket connect) perhaps the > > signal never gets sent. > > Lemmie know how it goes - we'll get it figured out. > > Mark > > > > PS there is a mailing list at sourceforge that you should join (very > low > > traffic) for questions such as these: > > http://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > > > On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > > > Hi, I hope you can help. I'm using your product as a way to migrate > > > some code from Perl to Java so it's a pretty key piece to our > > strategy. > > > > > > > > > > > > > > > Even though we put in alarms, we still end up with hung perl > > processes. > > > The processes seem to be hung on the line below that is bold, or > when > > it > > > calls out to > > > > > > $java = new Java(host => $perlJavaHost, > > > > > > port => $perlJavaPort, > > > > > > event_port => -1, > > > > > > use_tied_arrays => 1 > > > > > > ); > > > > > > > > > > > > Do you have any idea what we can do to solve this problem? Was this > a > > > known problem. The javaServer itself is very stable. This is the > > only > > > problem we know about. Is there a way to specify a timeout in the > > > connection request? > > > > > > > > > > > > Thanks so much in advance for any help you can provide. > > > > > > > > > > > > > > > > > > sub getJava { > > > > > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) = > @_; > > > > > > > > > > > > my $java; > > > > > > > > > > > > my $retries = 0; > > > > > > > > > > > > while ($retries < 2) { > > > > > > > > > > > > $retries ++; > > > > > > > > > > > > ## -- reset the timer for timeout before the eval block > > > > > > alarm 0; > > > > > > > > > > > > eval { > > > > > > local $SIG{ALRM} = sub { > > > > > > ## -- Signal handler to catch the ALRM signal > > > > > > ## -- log the timeout error and continue next > > iteration > > > > > > lib::perl::Infra::Log::Print("-- Timedout on the > > > JavaServer trying to get a Java object instance --"); > > > > > > next; > > > > > > }; > > > > > > > > > > > > lib::perl::Infra::Log::Print("-- Setting JavaServer > alarm > > > to: $timeout --"); > > > > > > > > > > > > alarm $timeout; > > > > > > > > > > > > $java = new Java(host => $perlJavaHost, > > > > > > port => $perlJavaPort, > > > > > > event_port => -1, > > > > > > use_tied_arrays => 1 > > > > > > ); > > > > > > > > > > > > lib::perl::Infra::Log::Print("-- Successfully obtained a > > > Java object --"); > > > > > > > > > > > > ## -- reset the timer for timeout > > > > > > alarm 0; > > > > > > }; > > > > > > > > > > > > if (defined $java) { > > > > > > return $java; > > > > > > } else { > > > > > > my $err = ""; > > > > > > if ($@) { $err = $@; } > > > > > > > > > > > > if ($main::gLogger){ > > > > > > $err = "JavaUtil.pm" . "," . "Failed obtaining Java > > object, > > > retry count=$retries " . "\n$err"; > > > > > > $main::gLogger->Log("ERROR",$err); > > > > > > } else { > > > > > > $err = "Failed obtaining Java object, retry > count=$retries > > " > > > . "\n$err"; > > > > > > lib::perl::Infra::Log::Print ($err); > > > > > > } > > > > > > > > > > > > restartJavaServer($javaServerRunner); > > > > > > sleep 5; > > > > > > } > > > > > > } > > > > > > > > > > > > return(undef); > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > Jordan > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product Guide on > ITManagersJournal > > Use IT products in your business? Tell us what you think of them. Give > us > > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > > http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > Javaserver-perl mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > |
From: Jordan R. <jr...@sh...> - 2004-10-14 16:43:17
|
It's hard to reproduce. It seems to happen when the machine is under high CPU load. =20 The JavaServer typically does have a lot of threads and does run for long periods of time. I just checked a production machine and there are 133 threads (ps -ef on Linux) total memory is 151 MB. Thinking about putting a socket timeout in Java.pm... even though it's running on localhost, what do you think? Jordan -----Original Message----- From: ma...@zz... [mailto:ma...@zz...]=20 Sent: Thursday, October 14, 2004 8:29 AM To: Jordan Redner Cc: jav...@li... Subject: Re: [Javaserver-perl] RE: Perl process hangs on new Java(...) call Can you telnet to 127.0.0.1 port 2000? Then try: #!perl use IO::Socket; my $socket =3D IO::Socket::INET->new ( PeerAddr =3D> '127.0.0.1', PeerPort =3D> 2000, ); & see if that hangs. Does it hang all of the time or only sometimes? Maybe it's the JavaServer process itself that's hanging. Hm. If only sometimes is it after JavaServer has been running for a while w/lots of objects? I don't think upgrading to 4.7 will help - it's better handling for Java protected fields. M On Thu, Oct 14, 2004 at 08:03:30AM -0700, Jordan Redner wrote: > Thanks so much for the fast response.=20 >=20 > Server port is always 127.0.0.1 >=20 > OS is a couple years old. >=20 > Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 17:34:59 > CEST 2002 i686=20 >=20 > Perl version 5.8.0 >=20 >=20 >=20 > Do you think upgrading from 4.6 to 4.7 will help? Are there any > synchronization issues which were fixed or anything like that? When I > read "better handling of private/protected fields/functions...", I > wasn't sure of what this meant internally. JavaServer runs on several > production machines, otherwise I'd just go ahead and try it. =20 >=20 > My next step is to install a timeout parm. in the socket constructor > inside Java.pm. What are your thoughts on this?? >=20 >=20 > Thanks for your help. >=20 >=20 >=20 > Jordan >=20 >=20 > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...]=20 > Sent: Wednesday, October 13, 2004 9:33 PM > To: Jordan Redner > Cc: jav...@li... > Subject: Re: Perl process hangs on new Java(...) call >=20 > The only interesting thing the Java.pm constructor does that may cause > it to hang is trying to connect to the remove JavaServer java process. > Try to telnet to port 2000 of your JavaServer machine from the machine > running the perl code to ensure you can make a connection between the > two. > Of course you'll want to make sure you're running compatible version > of Java.pm & JavaServer (the major version numbers match). > Perhaps your DNS is screwey & your JavaServer host is not be resolved? > As to why it stays hung - which operating system are you running on? > If perl is 'hung' in a system call (socket connect) perhaps the > signal never gets sent. > Lemmie know how it goes - we'll get it figured out. > Mark >=20 > PS there is a mailing list at sourceforge that you should join (very low > traffic) for questions such as these: > http://lists.sourceforge.net/lists/listinfo/javaserver-perl >=20 >=20 > On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > > Hi, I hope you can help. I'm using your product as a way to migrate > > some code from Perl to Java so it's a pretty key piece to our > strategy. > >=20 > >=20 > > =20 > >=20 > > Even though we put in alarms, we still end up with hung perl > processes. > > The processes seem to be hung on the line below that is bold, or when > it > > calls out to=20 > >=20 > > $java =3D new Java(host =3D> $perlJavaHost, > >=20 > > port =3D> $perlJavaPort, > >=20 > > event_port =3D> -1, > >=20 > > use_tied_arrays =3D> 1 > >=20 > > ); > >=20 > > =20 > >=20 > > Do you have any idea what we can do to solve this problem? Was this a > > known problem. The javaServer itself is very stable. This is the > only > > problem we know about. Is there a way to specify a timeout in the > > connection request? > >=20 > > =20 > >=20 > > Thanks so much in advance for any help you can provide. > >=20 > > =20 > >=20 > > =20 > >=20 > > sub getJava { > >=20 > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) =3D @_; > >=20 > > =20 > >=20 > > my $java; > >=20 > > =20 > >=20 > > my $retries =3D 0; > >=20 > > =20 > >=20 > > while ($retries < 2) { > >=20 > > =20 > >=20 > > $retries ++; > >=20 > > =20 > >=20 > > ## -- reset the timer for timeout before the eval block > >=20 > > alarm 0; > >=20 > > =20 > >=20 > > eval {=20 > >=20 > > local $SIG{ALRM} =3D sub { > >=20 > > ## -- Signal handler to catch the ALRM signal > >=20 > > ## -- log the timeout error and continue next > iteration > >=20 > > lib::perl::Infra::Log::Print("-- Timedout on the > > JavaServer trying to get a Java object instance --"); > >=20 > > next; > >=20 > > }; > >=20 > > =20 > >=20 > > lib::perl::Infra::Log::Print("-- Setting JavaServer alarm > > to: $timeout --"); > >=20 > > =20 > >=20 > > alarm $timeout; > >=20 > > =20 > >=20 > > $java =3D new Java(host =3D> $perlJavaHost, > >=20 > > port =3D> $perlJavaPort, > >=20 > > event_port =3D> -1, > >=20 > > use_tied_arrays =3D> 1 > >=20 > > ); > >=20 > > =20 > >=20 > > lib::perl::Infra::Log::Print("-- Successfully obtained a > > Java object --"); > >=20 > > =20 > >=20 > > ## -- reset the timer for timeout > >=20 > > alarm 0; > >=20 > > }; > >=20 > > =20 > >=20 > > if (defined $java) { > >=20 > > return $java; > >=20 > > } else { > >=20 > > my $err =3D ""; > >=20 > > if ($@) { $err =3D $@; } > >=20 > > =20 > >=20 > > if ($main::gLogger){ > >=20 > > $err =3D "JavaUtil.pm" . "," . "Failed obtaining Java > object, > > retry count=3D$retries " . "\n$err"; > >=20 > > $main::gLogger->Log("ERROR",$err); > >=20 > > } else { > >=20 > > $err =3D "Failed obtaining Java object, retry count=3D$retries > " > > . "\n$err"; > >=20 > > lib::perl::Infra::Log::Print ($err); > >=20 > > } > >=20 > > =20 > >=20 > > restartJavaServer($javaServerRunner); > >=20 > > sleep 5; > >=20 > > } > >=20 > > } > >=20 > > =20 > >=20 > > return(undef); > >=20 > > =20 > >=20 > > } > >=20 > > =20 > >=20 > > =20 > >=20 > > =20 > >=20 > > Jordan > >=20 > > =20 > >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-10-14 15:25:21
|
Can you telnet to 127.0.0.1 port 2000? Then try: #!perl use IO::Socket; my $socket = IO::Socket::INET->new ( PeerAddr => '127.0.0.1', PeerPort => 2000, ); & see if that hangs. Does it hang all of the time or only sometimes? Maybe it's the JavaServer process itself that's hanging. Hm. If only sometimes is it after JavaServer has been running for a while w/lots of objects? I don't think upgrading to 4.7 will help - it's better handling for Java protected fields. M On Thu, Oct 14, 2004 at 08:03:30AM -0700, Jordan Redner wrote: > Thanks so much for the fast response. > > Server port is always 127.0.0.1 > > OS is a couple years old. > > Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 17:34:59 > CEST 2002 i686 > > Perl version 5.8.0 > > > > Do you think upgrading from 4.6 to 4.7 will help? Are there any > synchronization issues which were fixed or anything like that? When I > read "better handling of private/protected fields/functions...", I > wasn't sure of what this meant internally. JavaServer runs on several > production machines, otherwise I'd just go ahead and try it. > > My next step is to install a timeout parm. in the socket constructor > inside Java.pm. What are your thoughts on this?? > > > Thanks for your help. > > > > Jordan > > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Wednesday, October 13, 2004 9:33 PM > To: Jordan Redner > Cc: jav...@li... > Subject: Re: Perl process hangs on new Java(...) call > > The only interesting thing the Java.pm constructor does that may cause > it to hang is trying to connect to the remove JavaServer java process. > Try to telnet to port 2000 of your JavaServer machine from the machine > running the perl code to ensure you can make a connection between the > two. > Of course you'll want to make sure you're running compatible version > of Java.pm & JavaServer (the major version numbers match). > Perhaps your DNS is screwey & your JavaServer host is not be resolved? > As to why it stays hung - which operating system are you running on? > If perl is 'hung' in a system call (socket connect) perhaps the > signal never gets sent. > Lemmie know how it goes - we'll get it figured out. > Mark > > PS there is a mailing list at sourceforge that you should join (very low > traffic) for questions such as these: > http://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > > Hi, I hope you can help. I'm using your product as a way to migrate > > some code from Perl to Java so it's a pretty key piece to our > strategy. > > > > > > > > > > Even though we put in alarms, we still end up with hung perl > processes. > > The processes seem to be hung on the line below that is bold, or when > it > > calls out to > > > > $java = new Java(host => $perlJavaHost, > > > > port => $perlJavaPort, > > > > event_port => -1, > > > > use_tied_arrays => 1 > > > > ); > > > > > > > > Do you have any idea what we can do to solve this problem? Was this a > > known problem. The javaServer itself is very stable. This is the > only > > problem we know about. Is there a way to specify a timeout in the > > connection request? > > > > > > > > Thanks so much in advance for any help you can provide. > > > > > > > > > > > > sub getJava { > > > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) = @_; > > > > > > > > my $java; > > > > > > > > my $retries = 0; > > > > > > > > while ($retries < 2) { > > > > > > > > $retries ++; > > > > > > > > ## -- reset the timer for timeout before the eval block > > > > alarm 0; > > > > > > > > eval { > > > > local $SIG{ALRM} = sub { > > > > ## -- Signal handler to catch the ALRM signal > > > > ## -- log the timeout error and continue next > iteration > > > > lib::perl::Infra::Log::Print("-- Timedout on the > > JavaServer trying to get a Java object instance --"); > > > > next; > > > > }; > > > > > > > > lib::perl::Infra::Log::Print("-- Setting JavaServer alarm > > to: $timeout --"); > > > > > > > > alarm $timeout; > > > > > > > > $java = new Java(host => $perlJavaHost, > > > > port => $perlJavaPort, > > > > event_port => -1, > > > > use_tied_arrays => 1 > > > > ); > > > > > > > > lib::perl::Infra::Log::Print("-- Successfully obtained a > > Java object --"); > > > > > > > > ## -- reset the timer for timeout > > > > alarm 0; > > > > }; > > > > > > > > if (defined $java) { > > > > return $java; > > > > } else { > > > > my $err = ""; > > > > if ($@) { $err = $@; } > > > > > > > > if ($main::gLogger){ > > > > $err = "JavaUtil.pm" . "," . "Failed obtaining Java > object, > > retry count=$retries " . "\n$err"; > > > > $main::gLogger->Log("ERROR",$err); > > > > } else { > > > > $err = "Failed obtaining Java object, retry count=$retries > " > > . "\n$err"; > > > > lib::perl::Infra::Log::Print ($err); > > > > } > > > > > > > > restartJavaServer($javaServerRunner); > > > > sleep 5; > > > > } > > > > } > > > > > > > > return(undef); > > > > > > > > } > > > > > > > > > > > > > > > > Jordan > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: Jordan R. <jr...@sh...> - 2004-10-14 14:58:27
|
Thanks so much for the fast response.=20 Server port is always 127.0.0.1 OS is a couple years old. Mandrake: Linux sj7 2.4.19-16mdkenterprise #1 SMP Fri Sep 20 17:34:59 CEST 2002 i686=20 Perl version 5.8.0 Do you think upgrading from 4.6 to 4.7 will help? Are there any synchronization issues which were fixed or anything like that? When I read "better handling of private/protected fields/functions...", I wasn't sure of what this meant internally. JavaServer runs on several production machines, otherwise I'd just go ahead and try it. =20 My next step is to install a timeout parm. in the socket constructor inside Java.pm. What are your thoughts on this?? Thanks for your help. Jordan -----Original Message----- From: ma...@zz... [mailto:ma...@zz...]=20 Sent: Wednesday, October 13, 2004 9:33 PM To: Jordan Redner Cc: jav...@li... Subject: Re: Perl process hangs on new Java(...) call The only interesting thing the Java.pm constructor does that may cause it to hang is trying to connect to the remove JavaServer java process. Try to telnet to port 2000 of your JavaServer machine from the machine running the perl code to ensure you can make a connection between the two. Of course you'll want to make sure you're running compatible version of Java.pm & JavaServer (the major version numbers match). Perhaps your DNS is screwey & your JavaServer host is not be resolved? As to why it stays hung - which operating system are you running on? If perl is 'hung' in a system call (socket connect) perhaps the signal never gets sent. Lemmie know how it goes - we'll get it figured out. Mark PS there is a mailing list at sourceforge that you should join (very low traffic) for questions such as these: http://lists.sourceforge.net/lists/listinfo/javaserver-perl On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > Hi, I hope you can help. I'm using your product as a way to migrate > some code from Perl to Java so it's a pretty key piece to our strategy. >=20 >=20 > =20 >=20 > Even though we put in alarms, we still end up with hung perl processes. > The processes seem to be hung on the line below that is bold, or when it > calls out to=20 >=20 > $java =3D new Java(host =3D> $perlJavaHost, >=20 > port =3D> $perlJavaPort, >=20 > event_port =3D> -1, >=20 > use_tied_arrays =3D> 1 >=20 > ); >=20 > =20 >=20 > Do you have any idea what we can do to solve this problem? Was this a > known problem. The javaServer itself is very stable. This is the only > problem we know about. Is there a way to specify a timeout in the > connection request? >=20 > =20 >=20 > Thanks so much in advance for any help you can provide. >=20 > =20 >=20 > =20 >=20 > sub getJava { >=20 > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) =3D = @_; >=20 > =20 >=20 > my $java; >=20 > =20 >=20 > my $retries =3D 0; >=20 > =20 >=20 > while ($retries < 2) { >=20 > =20 >=20 > $retries ++; >=20 > =20 >=20 > ## -- reset the timer for timeout before the eval block >=20 > alarm 0; >=20 > =20 >=20 > eval {=20 >=20 > local $SIG{ALRM} =3D sub { >=20 > ## -- Signal handler to catch the ALRM signal >=20 > ## -- log the timeout error and continue next iteration >=20 > lib::perl::Infra::Log::Print("-- Timedout on the > JavaServer trying to get a Java object instance --"); >=20 > next; >=20 > }; >=20 > =20 >=20 > lib::perl::Infra::Log::Print("-- Setting JavaServer alarm > to: $timeout --"); >=20 > =20 >=20 > alarm $timeout; >=20 > =20 >=20 > $java =3D new Java(host =3D> $perlJavaHost, >=20 > port =3D> $perlJavaPort, >=20 > event_port =3D> -1, >=20 > use_tied_arrays =3D> 1 >=20 > ); >=20 > =20 >=20 > lib::perl::Infra::Log::Print("-- Successfully obtained a > Java object --"); >=20 > =20 >=20 > ## -- reset the timer for timeout >=20 > alarm 0; >=20 > }; >=20 > =20 >=20 > if (defined $java) { >=20 > return $java; >=20 > } else { >=20 > my $err =3D ""; >=20 > if ($@) { $err =3D $@; } >=20 > =20 >=20 > if ($main::gLogger){ >=20 > $err =3D "JavaUtil.pm" . "," . "Failed obtaining Java object, > retry count=3D$retries " . "\n$err"; >=20 > $main::gLogger->Log("ERROR",$err); >=20 > } else { >=20 > $err =3D "Failed obtaining Java object, retry = count=3D$retries " > . "\n$err"; >=20 > lib::perl::Infra::Log::Print ($err); >=20 > } >=20 > =20 >=20 > restartJavaServer($javaServerRunner); >=20 > sleep 5; >=20 > } >=20 > } >=20 > =20 >=20 > return(undef); >=20 > =20 >=20 > } >=20 > =20 >=20 > =20 >=20 > =20 >=20 > Jordan >=20 > =20 >=20 |
From: <ma...@zz...> - 2004-10-14 04:29:38
|
The only interesting thing the Java.pm constructor does that may cause it to hang is trying to connect to the remove JavaServer java process. Try to telnet to port 2000 of your JavaServer machine from the machine running the perl code to ensure you can make a connection between the two. Of course you'll want to make sure you're running compatible version of Java.pm & JavaServer (the major version numbers match). Perhaps your DNS is screwey & your JavaServer host is not be resolved? As to why it stays hung - which operating system are you running on? If perl is 'hung' in a system call (socket connect) perhaps the signal never gets sent. Lemmie know how it goes - we'll get it figured out. Mark PS there is a mailing list at sourceforge that you should join (very low traffic) for questions such as these: http://lists.sourceforge.net/lists/listinfo/javaserver-perl On Wed, Oct 13, 2004 at 05:23:47PM -0700, Jordan Redner wrote: > Hi, I hope you can help. I'm using your product as a way to migrate > some code from Perl to Java so it's a pretty key piece to our strategy. > > > > > Even though we put in alarms, we still end up with hung perl processes. > The processes seem to be hung on the line below that is bold, or when it > calls out to > > $java = new Java(host => $perlJavaHost, > > port => $perlJavaPort, > > event_port => -1, > > use_tied_arrays => 1 > > ); > > > > Do you have any idea what we can do to solve this problem? Was this a > known problem. The javaServer itself is very stable. This is the only > problem we know about. Is there a way to specify a timeout in the > connection request? > > > > Thanks so much in advance for any help you can provide. > > > > > > sub getJava { > > my ($perlJavaHost,$perlJavaPort,$javaServerRunner,$timeout) = @_; > > > > my $java; > > > > my $retries = 0; > > > > while ($retries < 2) { > > > > $retries ++; > > > > ## -- reset the timer for timeout before the eval block > > alarm 0; > > > > eval { > > local $SIG{ALRM} = sub { > > ## -- Signal handler to catch the ALRM signal > > ## -- log the timeout error and continue next iteration > > lib::perl::Infra::Log::Print("-- Timedout on the > JavaServer trying to get a Java object instance --"); > > next; > > }; > > > > lib::perl::Infra::Log::Print("-- Setting JavaServer alarm > to: $timeout --"); > > > > alarm $timeout; > > > > $java = new Java(host => $perlJavaHost, > > port => $perlJavaPort, > > event_port => -1, > > use_tied_arrays => 1 > > ); > > > > lib::perl::Infra::Log::Print("-- Successfully obtained a > Java object --"); > > > > ## -- reset the timer for timeout > > alarm 0; > > }; > > > > if (defined $java) { > > return $java; > > } else { > > my $err = ""; > > if ($@) { $err = $@; } > > > > if ($main::gLogger){ > > $err = "JavaUtil.pm" . "," . "Failed obtaining Java object, > retry count=$retries " . "\n$err"; > > $main::gLogger->Log("ERROR",$err); > > } else { > > $err = "Failed obtaining Java object, retry count=$retries " > . "\n$err"; > > lib::perl::Infra::Log::Print ($err); > > } > > > > restartJavaServer($javaServerRunner); > > sleep 5; > > } > > } > > > > return(undef); > > > > } > > > > > > > > Jordan > > > |
From: <ma...@zz...> - 2004-07-21 17:44:04
|
Hey if blackdown works best for you guys then I'm all for it! I was under the impression that 1.4.x fixed a bunch of bugs & was faster BUT I was wrong (once!) before so go with whatever works best for you. JavaServer does NOT bind to the loopback interface... Mark On Tue, Jul 20, 2004 at 08:32:13AM +0800, Shao Ming wrote: > > Was looking round for JVM for linux and bump into this benchmarking report. > http://www.volano.com/report/index.html > I was using blackdown 1.4.2. It seem that 1.4.x series seem to have network > scability performance issues. I believe the JavaServer falls under this > category, right? Can't recall whether it was actually using loopback. The > blackdown 1.3.x seem to have better performance. > /shaoming > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Tuesday, July 20, 2004 8:18 AM > To: Shao Ming > Cc: jav...@li... > Subject: Re: [Javaserver-perl] Re: JavaServer dies when under heavy load > > Even if you don't need the stuff added in 1.4.x there were many bugfixes & > speed enhancements (& more of that in upcoming 1.5 whatever-the-heck it's > gonna be called)... > So unless you REALLY don't want to upgrade using 1.4.x is optimal. > Mark > > On Tue, Jul 20, 2004 at 08:13:39AM +0800, Shao Ming wrote: > > > > Hi to all, > > > > Haven't had time to troubleshoot the issue, will be doing in the next > > few days. > > But one quick question came to mind, what are the preferred JVM you > > guys are using for your linux box? And if I do not need the Java2 > > features ... Is 1.3.x series a better choice than 1.4.x? > > > > Cheers! > > /shaoming > > > > -----Original Message----- > > From: jav...@li... > > [mailto:jav...@li...] On Behalf Of > > ma...@zz... > > Sent: Tuesday, July 13, 2004 12:21 PM > > To: Shao Ming > > Cc: jav...@li... > > Subject: [Javaserver-perl] Re: JavaServer dies when under heavy load > > > > Hey Shao, > > I would recommend running JavaServer under a profiler or debugger > > to see better what's going on. Does the JVM crash? Does JavaServer > > hang? Is there a stack trace? > > Of course you can create a simple shell watchdog script to restart > > JavaServer if it goes away but better to find out the root cause - I > > cannot think of a reason why JavaServer would crash under heavy load > > from 24 users unless there's a memory leak or you run out of system > resources somewhere. > > Of course there could be a JVM bug or any number of things that causes > this. > > & please write to the list 'jav...@li...' > > so everyone can benefit from this discussion - join @ > > http://sourceforge.net/projects/javaserver/ > > thanks! > > Mark > > > > On Tue, Jul 13, 2004 at 11:14:58AM +0800, Shao Ming wrote: > > > Hi Mark, > > > > > > first of all, thanks again for the fine piece of work. > > > > > > During our Performance testing, we discover that JavaServer will die > > > under heavy load (when we simulate abt 24 virtual users). > > > > > > Do you know of any particluar reason why JavaServer cannot handle > > > the > > load? > > > Or alternatively, do you know of any 3rd party app that can monitor > > > running instance of JavaServer and restart the daemon when its down? > > > > > > this is just the last hurdle I need to rectify before rolling out > > > the app for production. > > > > > > thanks for your attention. > > > > > > regards, > > > /shaoming > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by Black Hat Briefings & Training. > > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > > self defense, top technical experts, no vendor pitches, unmatched > > networking opportunities. Visit www.blackhat.com > > _______________________________________________ > > Javaserver-perl mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java > > Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > > _______________________________________________ > > Javaserver-perl mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: Shao M. <sha...@si...> - 2004-07-20 00:32:22
|
Was looking round for JVM for linux and bump into this benchmarking report. http://www.volano.com/report/index.html I was using blackdown 1.4.2. It seem that 1.4.x series seem to have network scability performance issues. I believe the JavaServer falls under this category, right? Can't recall whether it was actually using loopback. The blackdown 1.3.x seem to have better performance. /shaoming -----Original Message----- From: ma...@zz... [mailto:ma...@zz...] Sent: Tuesday, July 20, 2004 8:18 AM To: Shao Ming Cc: jav...@li... Subject: Re: [Javaserver-perl] Re: JavaServer dies when under heavy load Even if you don't need the stuff added in 1.4.x there were many bugfixes & speed enhancements (& more of that in upcoming 1.5 whatever-the-heck it's gonna be called)... So unless you REALLY don't want to upgrade using 1.4.x is optimal. Mark On Tue, Jul 20, 2004 at 08:13:39AM +0800, Shao Ming wrote: > > Hi to all, > > Haven't had time to troubleshoot the issue, will be doing in the next > few days. > But one quick question came to mind, what are the preferred JVM you > guys are using for your linux box? And if I do not need the Java2 > features ... Is 1.3.x series a better choice than 1.4.x? > > Cheers! > /shaoming > > -----Original Message----- > From: jav...@li... > [mailto:jav...@li...] On Behalf Of > ma...@zz... > Sent: Tuesday, July 13, 2004 12:21 PM > To: Shao Ming > Cc: jav...@li... > Subject: [Javaserver-perl] Re: JavaServer dies when under heavy load > > Hey Shao, > I would recommend running JavaServer under a profiler or debugger > to see better what's going on. Does the JVM crash? Does JavaServer > hang? Is there a stack trace? > Of course you can create a simple shell watchdog script to restart > JavaServer if it goes away but better to find out the root cause - I > cannot think of a reason why JavaServer would crash under heavy load > from 24 users unless there's a memory leak or you run out of system resources somewhere. > Of course there could be a JVM bug or any number of things that causes this. > & please write to the list 'jav...@li...' > so everyone can benefit from this discussion - join @ > http://sourceforge.net/projects/javaserver/ > thanks! > Mark > > On Tue, Jul 13, 2004 at 11:14:58AM +0800, Shao Ming wrote: > > Hi Mark, > > > > first of all, thanks again for the fine piece of work. > > > > During our Performance testing, we discover that JavaServer will die > > under heavy load (when we simulate abt 24 virtual users). > > > > Do you know of any particluar reason why JavaServer cannot handle > > the > load? > > Or alternatively, do you know of any 3rd party app that can monitor > > running instance of JavaServer and restart the daemon when its down? > > > > this is just the last hurdle I need to rectify before rolling out > > the app for production. > > > > thanks for your attention. > > > > regards, > > /shaoming > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > self defense, top technical experts, no vendor pitches, unmatched > networking opportunities. Visit www.blackhat.com > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java > Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-07-20 00:18:17
|
Even if you don't need the stuff added in 1.4.x there were many bugfixes & speed enhancements (& more of that in upcoming 1.5 whatever-the-heck it's gonna be called)... So unless you REALLY don't want to upgrade using 1.4.x is optimal. Mark On Tue, Jul 20, 2004 at 08:13:39AM +0800, Shao Ming wrote: > > Hi to all, > > Haven't had time to troubleshoot the issue, will be doing in the next few > days. > But one quick question came to mind, what are the preferred JVM you guys are > using for your linux box? And if I do not need the Java2 features ... Is > 1.3.x series a better choice than 1.4.x? > > Cheers! > /shaoming > > -----Original Message----- > From: jav...@li... > [mailto:jav...@li...] On Behalf Of > ma...@zz... > Sent: Tuesday, July 13, 2004 12:21 PM > To: Shao Ming > Cc: jav...@li... > Subject: [Javaserver-perl] Re: JavaServer dies when under heavy load > > Hey Shao, > I would recommend running JavaServer under a profiler or debugger to see > better what's going on. Does the JVM crash? Does JavaServer hang? Is > there a stack trace? > Of course you can create a simple shell watchdog script to restart > JavaServer if it goes away but better to find out the root cause - I cannot > think of a reason why JavaServer would crash under heavy load from 24 users > unless there's a memory leak or you run out of system resources somewhere. > Of course there could be a JVM bug or any number of things that causes this. > & please write to the list 'jav...@li...' > so everyone can benefit from this discussion - join @ > http://sourceforge.net/projects/javaserver/ > thanks! > Mark > > On Tue, Jul 13, 2004 at 11:14:58AM +0800, Shao Ming wrote: > > Hi Mark, > > > > first of all, thanks again for the fine piece of work. > > > > During our Performance testing, we discover that JavaServer will die > > under heavy load (when we simulate abt 24 virtual users). > > > > Do you know of any particluar reason why JavaServer cannot handle the > load? > > Or alternatively, do you know of any 3rd party app that can monitor > > running instance of JavaServer and restart the daemon when its down? > > > > this is just the last hurdle I need to rectify before rolling out the > > app for production. > > > > thanks for your attention. > > > > regards, > > /shaoming > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self > defense, top technical experts, no vendor pitches, unmatched networking > opportunities. Visit www.blackhat.com > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: Shao M. <sha...@si...> - 2004-07-20 00:13:47
|
Hi to all, Haven't had time to troubleshoot the issue, will be doing in the next few days. But one quick question came to mind, what are the preferred JVM you guys are using for your linux box? And if I do not need the Java2 features ... Is 1.3.x series a better choice than 1.4.x? Cheers! /shaoming -----Original Message----- From: jav...@li... [mailto:jav...@li...] On Behalf Of ma...@zz... Sent: Tuesday, July 13, 2004 12:21 PM To: Shao Ming Cc: jav...@li... Subject: [Javaserver-perl] Re: JavaServer dies when under heavy load Hey Shao, I would recommend running JavaServer under a profiler or debugger to see better what's going on. Does the JVM crash? Does JavaServer hang? Is there a stack trace? Of course you can create a simple shell watchdog script to restart JavaServer if it goes away but better to find out the root cause - I cannot think of a reason why JavaServer would crash under heavy load from 24 users unless there's a memory leak or you run out of system resources somewhere. Of course there could be a JVM bug or any number of things that causes this. & please write to the list 'jav...@li...' so everyone can benefit from this discussion - join @ http://sourceforge.net/projects/javaserver/ thanks! Mark On Tue, Jul 13, 2004 at 11:14:58AM +0800, Shao Ming wrote: > Hi Mark, > > first of all, thanks again for the fine piece of work. > > During our Performance testing, we discover that JavaServer will die > under heavy load (when we simulate abt 24 virtual users). > > Do you know of any particluar reason why JavaServer cannot handle the load? > Or alternatively, do you know of any 3rd party app that can monitor > running instance of JavaServer and restart the daemon when its down? > > this is just the last hurdle I need to rectify before rolling out the > app for production. > > thanks for your attention. > > regards, > /shaoming ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Javaserver-perl mailing list Jav...@li... https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-07-13 04:21:02
|
Hey Shao, I would recommend running JavaServer under a profiler or debugger to see better what's going on. Does the JVM crash? Does JavaServer hang? Is there a stack trace? Of course you can create a simple shell watchdog script to restart JavaServer if it goes away but better to find out the root cause - I cannot think of a reason why JavaServer would crash under heavy load from 24 users unless there's a memory leak or you run out of system resources somewhere. Of course there could be a JVM bug or any number of things that causes this. & please write to the list 'jav...@li...' so everyone can benefit from this discussion - join @ http://sourceforge.net/projects/javaserver/ thanks! Mark On Tue, Jul 13, 2004 at 11:14:58AM +0800, Shao Ming wrote: > Hi Mark, > > first of all, thanks again for the fine piece of work. > > During our Performance testing, we discover that JavaServer will die under > heavy load (when we simulate abt 24 virtual users). > > Do you know of any particluar reason why JavaServer cannot handle the load? > Or alternatively, do you know of any 3rd party app that can monitor running > instance of JavaServer and restart the daemon when its down? > > this is just the last hurdle I need to rectify before rolling out the app > for production. > > thanks for your attention. > > regards, > /shaoming |
From: <ben...@id...> - 2004-05-25 08:38:36
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: <ma...@zz...> - 2004-04-14 22:31:59
|
Hm that's lame. You should be able to go the URL below, sign up & become a member of the list, & then view previous posts at this URL: http://sourceforge.net/mailarchive/forum.php?forum=javaserver-perl I just tried it & it worked. Mark On Thu, Apr 15, 2004 at 06:28:54AM +0800, Shao Ming wrote: > > Thanks for the info. However, sf is coughing a 'ERROR - Forum not found' > message when I try to view postings. > > Regards. > > -----Original Message----- > From: ma...@zz... [mailto:ma...@zz...] > Sent: Thursday, April 15, 2004 12:37 AM > To: Shao Ming > Cc: jav...@li... > Subject: Re: Some Query on JavaServer > > Hey Shao, > Please post future questions to the > 'jav...@li...' > email list - you can become a member at: > http://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > On Wed, Apr 14, 2004 at 12:20:17PM +0800, Shao Ming wrote: > > > > Hi Mark, > > > > first ... thanks for your great work. > > > > I have a query on the performance of the Javaserver. > > Do you know how many simultaneous connections can it accept? > > I haven't tested this so am not sure - basically it depends on the hardware > the JVM is running on. There's no hard limit. For every connection > JavaServer spawns off a thread to deal with it. > I guess the theoretical maximum is 65534 since each connection needs a port > on the server machine (& the 1 one well known port) - of course in reality > you've got other services listening on other ports so you'd run out before > then. I'd guess 60000 would be about the max if your JVM/hardware can deal > with that number of Threads efficiently enough. > > > > > And how can I incease the amount of child processes listening? > > > > Same as above. > Now there is the standard (UNIX at least) 5 number of maximum queued > connections so if you're client are connecting simultaneously only 5 can be > queued up at a time while the JavaServer process deals with spawning a > connection. Assuming you don't have more than 5 clients trying to connect > at once this is not a problem. > Also this value is tweakable, not sure thru Java, but for sure via your OS. > > Mark > > |
From: <ma...@zz...> - 2004-04-14 16:37:35
|
Hey Shao, Please post future questions to the 'jav...@li...' email list - you can become a member at: http://lists.sourceforge.net/lists/listinfo/javaserver-perl On Wed, Apr 14, 2004 at 12:20:17PM +0800, Shao Ming wrote: > > Hi Mark, > > first ... thanks for your great work. > > I have a query on the performance of the Javaserver. > Do you know how many simultaneous connections can it accept? I haven't tested this so am not sure - basically it depends on the hardware the JVM is running on. There's no hard limit. For every connection JavaServer spawns off a thread to deal with it. I guess the theoretical maximum is 65534 since each connection needs a port on the server machine (& the 1 one well known port) - of course in reality you've got other services listening on other ports so you'd run out before then. I'd guess 60000 would be about the max if your JVM/hardware can deal with that number of Threads efficiently enough. > > And how can I incease the amount of child processes listening? > Same as above. Now there is the standard (UNIX at least) 5 number of maximum queued connections so if you're client are connecting simultaneously only 5 can be queued up at a time while the JavaServer process deals with spawning a connection. Assuming you don't have more than 5 clients trying to connect at once this is not a problem. Also this value is tweakable, not sure thru Java, but for sure via your OS. Mark |
From: <ma...@zz...> - 2004-04-01 22:21:04
|
Other than ensuring all of SomeVendorClass's .jar files are in your classpath it should all 'just work'. Also what version of the Java stuff are you using? Are you trying to call methods in MyClass or in the vendor's stuff? Email me a snippet of your perl code. Also there is now a mailing list for javaserver at: http://sourceforge.net/mail/?group_id=94932 The javaserver-perl list is the one you want - please email to the list so this stuff can get archived for future users... thanks! M On Thu, Apr 01, 2004 at 03:26:49PM -0500, Marc C Mettes wrote: > > > I am revisiting embedding your Javaserver. I got the reflection methods > to work and I have documented the vendor's java class and methods. > Unfortunately, I'm still getting class not found messages. > > My java code that gets called by the vendor app looks like this: > > import stuff ... > class MyClass extends SomeVendorClass { > Object object = (SomeVendorClass) getInterface(); > object.method1(); > JavaServer js = new JavaServer; > js.start(); > other stuff.... > } > > I think that since JavaServer isn't connected with (doesn't extend) > SomeVendorClass, > I cannot access SomeVendorClass methods from JavaServer objects. All of > your > examples seem to work fine though. > > I tried changing your code so that it imports the same packages and extends > the same > classes, but this generated some nasty java.lang.ClassLoader messages. I > didn't > import the packages in all of the java files however. > > > Any suggestions about where I'm going wrong or about the assumptions I'm > making here? > > > Thanks again, > > Marc > > ---------------------------------------------------------------------------------------- > > This is a PRIVATE message. If you are not the intended recipient, please > delete without copying and kindly advise us by e-mail of the mistake in > delivery. NOTE: Regardless of content, this e-mail shall not operate to > bind CSC to any order or other contract unless pursuant to explicit written > agreement or government initiative expressly permitting the use of e-mail > for such purpose. > ---------------------------------------------------------------------------------------- > > > > > > mark > @zzo.com To: Marc C Mettes/GIS/CSC@CSC > cc: > 11/18/2003 05:49 Subject: Re: Java.pm > PM > > > > > > > maybe there's some weird voodoo going on in there - private classes > or something that reflection can't see... > m > > On Fri, Nov 14, 2003 at 10:01:03AM -0500, Marc C Mettes wrote: > > > > Just to give you some feedback .... > > > > I was trying to get the classes (from the proprietary java code) to print > > the available method (using getmethods or something) and it gave me > > errors ... it just could not report anything. javap gave me nothing > > either. > > > > I noticed that your Dealer class uses this, and this may explain why it > > can't call this code. > > > > > > Thanks again for the help, > > > > Marc > > > > > ---------------------------------------------------------------------------------------- > > > > > This is a PRIVATE message. If you are not the intended recipient, please > > delete without copying and kindly advise us by e-mail of the mistake in > > delivery. NOTE: Regardless of content, this e-mail shall not operate to > > bind CSC to any order or other contract unless pursuant to explicit > written > > agreement or government initiative expressly permitting the use of e-mail > > for such purpose. > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > mark > > > @zzo.com To: Marc C Mettes > <mm...@cs...> > > cc: > > > 10/31/2003 05:08 Subject: Re: Java.pm > > > PM > > > > > > > > > > > > > > > > > Hey Marc, > > Sorry I haven't had a chance to look at this closer - I'm in the > > process of getting this whole project up on SourceForge so things are > > sorta in flux until I hear one way or another if it's gonna get up > > there or not... > > M > > > > On Wed, Oct 22, 2003 at 12:49:53PM -0400, Marc C Mettes wrote: > > > > > > I'm not sure I completely understand your question, but I did try many > > > variations > > > in perl trying to access the method ... no luck. > > > > > > If you are referring to changing the original java code that I showed > > you, > > > I can't > > > do that. I'm limited to how and what the java app author has allowed > me > > to > > > execute. I have little access to the source code, so I'm really > shooting > > > in the > > > dark. I had used jad in the past to examine the java source code, but > I > > > cannot > > > find it on the web now. > > > > > > I'm pretty sure that altering the Dealer class will get me in the right > > > direction, > > > but that is more of a long term project. For now, it seems that I'm at > a > > > dead > > > end, but I want to provide you with as much info as possible, in case > you > > > want/need to alter your code. It seems to work flawlessly for the > > examples > > > even though I have embedded your JavaServer into another java app. > > > > > > > > > Again thank you very much for you assistance, it was very educational. > > As > > > I said, I'm a Java newbie, but now I have a good understanding of what > > your > > > code is trying to do - and it's not trivial. If I have any success, > > either > > > changing > > > your code or rewriting an equivalent, I'll send it to you. > > > > > > > > > Marc > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > This is a PRIVATE message. If you are not the intended recipient, > please > > > delete without copying and kindly advise us by e-mail of the mistake in > > > delivery. NOTE: Regardless of content, this e-mail shall not operate to > > > bind CSC to any order or other contract unless pursuant to explicit > > written > > > agreement or government initiative expressly permitting the use of > e-mail > > > for such purpose. > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > @zzo.com To: Marc C Mettes > > <mm...@cs...> > > > cc: > > > > > 10/22/2003 12:14 Subject: Re: Java.pm > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > did you already try -not- putting the class that gets the Interface > > object > > > in a package - & then within perl call the 'getScriptInterface' > function? > > > M > > > > > > On Tue, Oct 21, 2003 at 02:59:47PM -0400, Marc C Mettes wrote: > > > > > > > > Unfortunately making that object public did not work, nor did > importing > > > the > > > > same > > > > packages either, as you predicted. I tried to change the JavaServer > > > class > > > > to > > > > extend the scripting classes, but that did not go well. Lots of > > DefClass > > > > not found > > > > or other similar messages. > > > > > > > > Should I try passing the IL object down into the JavaServer start() > > > method? > > > > Then > > > > perhaps JavaServer can operate on it. Or perhaps I need to rewrite > the > > > > Dealer > > > > class so that it can deal with the getScriptInterface() method? > > > > > > > > I'm still not sure why Java.pm perl code can execute java.* classes, > > yet > > > > doesn't > > > > think that com.ptc.* classes exist. It is running within the main() > of > > a > > > > com.ptc.* app. > > > > Confusing... > > > > > > > > > > > > Marc > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended recipient, > > please > > > > delete without copying and kindly advise us by e-mail of the mistake > in > > > > delivery. NOTE: Regardless of content, this e-mail shall not operate > to > > > > bind CSC to any order or other contract unless pursuant to explicit > > > written > > > > agreement or government initiative expressly permitting the use of > > e-mail > > > > for such purpose. > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > @zzo.com To: Marc C > > > Mettes/GIS/CSC@CSC > > > > cc: > > > > > > > 10/21/2003 12:54 Subject: Re: Java.pm > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > try making it public if you haven't already & lemmie know. > > > > M > > > > > > > > On Tue, Oct 21, 2003 at 07:37:40AM -0400, Marc C Mettes wrote: > > > > > > > > > > Mark, > > > > > > > > > > Here is the code in which I have inserted the JavaServer. I'm > trying > > > to > > > > > call the > > > > > methods of the IL object (or at least of some > > > ILIntralinkScriptInterface > > > > > object). > > > > > I don't see a constructor, but apparently the getScriptInterface() > > > > function > > > > > is > > > > > acting like a constructor. > > > > > > > > > > Should I make the declaration of the IL object below public? Would > > > that > > > > > allow > > > > > me to call it from within a JavaServer thread? > > > > > > > > > > > > > > > import com.ptc.intralink.client.script.*; > > > > > import com.ptc.intralink.script.*; > > > > > > > > > > public class Jserv extends ILIntralinkScript { > > > > > ILIntralinkScriptInterface IL > > > > > = (ILIntralinkScriptInterface)getScriptInterface(); > > > > > > > > > > private void run0 () throws Exception { > > > > > > > > > > // IL.openWindow( "Login", "user1", null ); > > > > > // IL.setLoginParameter( "INTRALINK_PASSWD", "passwd1" ); > > > > > // IL.ok( ); > > > > > > > > > > JavaServer js = new JavaServer(); > > > > > System.out.println("Before: Starting JavaServer"); > > > > > js.start(); // Start server on new thread > > > > > js.serv.runner.join(); // Join threads so process waits > > > > > > > > > > System.out.println("After: Starting JavaServer"); > > > > > > > > > > } > > > > > > > > > > public void run () throws Exception { > > > > > run0 (); > > > > > } > > > > > > > > > > } > > > > > > > > > > > > > > > Marc > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended recipient, > > > please > > > > > delete without copying and kindly advise us by e-mail of the > mistake > > in > > > > > delivery. NOTE: Regardless of content, this e-mail shall not > operate > > to > > > > > bind CSC to any order or other contract unless pursuant to explicit > > > > written > > > > > agreement or government initiative expressly permitting the use of > > > e-mail > > > > > for such purpose. > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > > > @zzo.com To: Marc C > > > > Mettes/GIS/CSC@CSC > > > > > cc: > > > > > > > > > 10/20/2003 04:56 Subject: Re: Java.pm > > > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > no you should not need to import them in the java code - as long > > > > > as you give a 'full path' to them when creating them & they're > > > > > available via the classpath they will be found. > > > > > Does that class have a constructor that takes no args - or that > > > > > just takes one String as the arg? > > > > > M > > > > > > > > > > On Mon, Oct 20, 2003 at 05:00:45PM -0400, Marc C Mettes wrote: > > > > > > > > > > > > I have that part taken care of already. The application is > started > > > > with > > > > > a > > > > > > command line > > > > > > like this: > > > > > > > > > > > > java -Xmx256m -ss8m -Xbootclasspath/a:c:\wkdir\NewJavaServer.jar > > -jar > > > > c: > > > > > > \wkdir\ilink\java\lib\Intralink.jar > > > > > > > > > > > > > > > > > > The classes are contained in Intralink.jar. I'm calling > JavaServer > > > > from > > > > > > within the app, > > > > > > but the perl code doesn't seem to know about them. Do I have to > > > import > > > > > > into the > > > > > > JavaServer code or something like that? I guess that JavaServer > > > needs > > > > to > > > > > > be aware > > > > > > of these classes in the source code so that it can call > > > > > getScriptInterface > > > > > > () and > > > > > > get the object to work with. > > > > > > > > > > > > > > > > > > Any thoughts? > > > > > > > > > > > > > > > > > > Marc > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended recipient, > > > > please > > > > > > delete without copying and kindly advise us by e-mail of the > > mistake > > > in > > > > > > delivery. NOTE: Regardless of content, this e-mail shall not > > operate > > > to > > > > > > bind CSC to any order or other contract unless pursuant to > explicit > > > > > written > > > > > > agreement or government initiative expressly permitting the use > of > > > > e-mail > > > > > > for such purpose. > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > > > > > @zzo.com To: Marc C > > > > > Mettes/GIS/CSC@CSC > > > > > > cc: > > > > > > > > > > > 10/20/2003 04:35 Subject: Re: > Java.pm > > > > > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > you need to make sure these classes (or the .jar they live in) > are > > > > > > enumerated > > > > > > in your classpath... > > > > > > so you start JavaServer like > > > > > > % java -classpath > /path/to/stuff:/path/to/JavaServer/JavaServer.jar > > > > > > JavaServer > > > > > > > > > > > > M > > > > > > > > > > > > On Mon, Oct 20, 2003 at 04:10:27PM -0400, Marc C Mettes wrote: > > > > > > > > > > > > > > The test.pl script works about 99% when the Test.class is added > > > back > > > > > in. > > > > > > > Even the swing examples work pretty much as advertised. > > > > > > > > > > > > > > I'm stumped though with calling the methods for my app. I've > > tried > > > > all > > > > > > of > > > > > > > the following, but I keep getting error about class not found: > > > > > > > > > > > > > > use lib '.'; > > > > > > > use Java; > > > > > > > my $java = new Java(host=>wa695347, port=>2000); > > > > > > > > > > > > > > # my $il = $java->create_object > > > > > > > > > > > > > > > > > > > > > > > > > > > > ("com.ptc.intralink.script.ILAbstractScriptPlayer.getScriptInterface",""); > > > > > > > # my $il = $java->create_object > > > > > > > ("com.ptc.intralink.script.ILScript.getScriptInterface",""); > > > > > > > # my $il = $java->create_object > > > > > > > > > > > > > > > > > > > > > > > > > > > > ("com.ptc.intralink.client.script.ILIntralinkScript.getScriptInterface",""); > > > > > > > > > > > > > > > > > > > > > > > > > > > > # my $il = $java->create_object > > > > > > > > > > > > > > > > > > > > > > > > > > > > ("com.ptc.intralink.client.script.ILIntralinkScriptMethods.getScriptInterface",""); > > > > > > > > > > > > > > > > > > > > > > > > > > > > # my $il = $java->create_object > > > > > > > > > > > > > > > > > > > > > > > > > > > > ("com.ptc.intralink.client.user.UserActionTrigger.getScriptInterface",""); > > > > > > > # my $il = $java->create_object > > > > > > > > > > ("com.ptc.intralink.script.ILScriptInterface.getScriptInterface",""); > > > > > > > # $il->call('openWindow', "Locate", "", ""); > > > > > > > > > > > > > > # $java->call("IL.openWindow", "Locate", "", ""); > > > > > > > > > > > > > > # my $il = $java->create_object > > > > > > > ("com.ptc.intralink.script.ILScriptInterface",""); > > > > > > > # my $il = $java->create_object > > > > > ("com.ptc.intralink.script.ILScript",""); > > > > > > > my $il = $java->create_object("ILScriptInterface"); > > > > > > > > > > > > > > > > > > > > > Each of the above generate something like this: > > > > > > > > > > > > > > ERROR: java.lang.Exception: Class ILScriptInterface don't > exist! > > at > > > > > > > ilink_test.pl line 18 > > > > > > > > > > > > > > > > > > > > > > > > > > > > It's a proprietary java app, so I have no source code. > > > > > > > > > > > > > > > > > > > > > Marc > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended > recipient, > > > > > please > > > > > > > delete without copying and kindly advise us by e-mail of the > > > mistake > > > > in > > > > > > > delivery. NOTE: Regardless of content, this e-mail shall not > > > operate > > > > to > > > > > > > bind CSC to any order or other contract unless pursuant to > > explicit > > > > > > written > > > > > > > agreement or government initiative expressly permitting the use > > of > > > > > e-mail > > > > > > > for such purpose. > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > > > > > > > @zzo.com To: Marc C > > > Mettes > > > > > > <mm...@cs...> > > > > > > > cc: > > > > > > > > > > > > > 10/20/2003 01:41 Subject: Re: > > Java.pm > > > > > > > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Oct 20, 2003 at 01:31:56PM -0400, Marc C Mettes wrote: > > > > > > > > > > > > > > > > > > > > > > > > I am using it with a 1.3.1-b24 JVM on windows, but the same > app > > > > runs > > > > > > > > with a 1.2.2 JVM on solaris as well. I was trying to compile > > > using > > > > > the > > > > > > > > native javac on solaris 8 (1.1.8). I was hoping to use the > > test > > > > > > scripts > > > > > > > > to make sure everything works. > > > > > > > > > > > > > > > > Here's a thought, how about using the old Test.class that you > > > have > > > > > > > > already compiled? I didn't think about that. > > > > > > > > > > > > > > > > > If I want to call the Java.pm equivalent of this: > > > > > > > > > > > > > > > > > > IL.openWindow( "Login", "user1", null ); > > > > > > > > > IL.setLoginParameter( "INTRALINK_PASSWD", "passwd1" ); > > > > > > > > > IL.ok( ); > > > > > > > > > > > > > > it'll look like: > > > > > > > $il->openWindow("Login", "user1", undef); > > > > > > > $il->setLoginParameter("INTRALINK_PASSWD", "passwd1" ); > > > > > > > $il->ok; > > > > > > > > > > > > > > Yah the NULL pointer on portscan is just JavaServer trying to > > read > > > > info > > > > > > > from the open connection but the portscan just immediately > closes > > > the > > > > > > > connection which makes that thread within JavaServer barf - no > > big. > > > > > > > > > > > > > > Still can't think of why the Test.java won't compile - yah just > > use > > > > > > > Test.class > > > > > > > that came w/it BUT I still think there's a problem w/the test > > > script. > > > > > > > M > > > > > > > > > > > > > > > > > > > > > > > > > What would the perl syntax look like? The IL object is > > defined > > > > in > > > > > > the > > > > > > > > code > > > > > > > > > snippet > > > > > > > > > that I had sent you last week. > > > > > > > > > > > > > > > > > > > > > > > > > > > On a side note, when I ran a portscan to see if JavaServer > > was > > > > > > > listening > > > > > > > > on > > > > > > > > > 2000, > > > > > > > > > the following error message appeared. To help me better > > > > > understand, > > > > > > > your > > > > > > > > > code > > > > > > > > > is trying to execute whatever is coming at it as Java code, > > > > right? > > > > > > > Since > > > > > > > > > I'm not > > > > > > > > > sending any data in the portscan, it tries to execute null > > code > > > > or > > > > > > > > > something. > > > > > > > > > > > > > > > > > > java.lang.NullPointerException > > > > > > > > > at SocketHandler.run(SocketHandler.java:104) > > > > > > > > > at TCPServer.run(TCPServer.java:141) > > > > > > > > > at java.lang.Thread.run(Thread.java:484) > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks again for the help, > > > > > > > > > > > > > > > > > > Marc > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended > > > recipient, > > > > > > > please > > > > > > > > > delete without copying and kindly advise us by e-mail of > the > > > > > mistake > > > > > > in > > > > > > > > > delivery. NOTE: Regardless of content, this e-mail shall > not > > > > > operate > > > > > > to > > > > > > > > > bind CSC to any order or other contract unless pursuant to > > > > explicit > > > > > > > > written > > > > > > > > > agreement or government initiative expressly permitting the > > use > > > > of > > > > > > > e-mail > > > > > > > > > for such purpose. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > > > > > > > > > > > @zzo.com To: > Marc > > C > > > > > Mettes > > > > > > > > <mm...@cs...> > > > > > > > > > cc: > > > > > > > > > > > > > > > > > 10/16/2003 06:55 Subject: Re: > > > > Java.pm > > > > > > > > > > > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > okay here's what you need to do. > > > > > > > > > In JavaServer.java make 'private static SocketHandler serv' > > > > public. > > > > > > > > > Then after you 'js.start();' do a 'js.serv.runner.join();' > & > > > > you'll > > > > > > > wait. > > > > > > > > > M > > > > > > > > > > > > > > > > > > On Thu, Oct 16, 2003 at 05:08:07PM -0400, Marc C Mettes > > wrote: > > > > > > > > > > > > > > > > > > > > Mark, > > > > > > > > > > > > > > > > > > > > Thanks for the responses. I got the java code to compile > > > (and > > > > a > > > > > > > dummy > > > > > > > > > one > > > > > > > > > > prints > > > > > > > > > > "Hello World", so I know it can work), however the code > > below > > > > > > doesn't > > > > > > > > > wait, > > > > > > > > > > perhaps > > > > > > > > > > because it starts a new thread. > > > > > > > > > > > > > > > > > > > > I need my app to wait for the JavaServer events, and only > > > > resume > > > > > > when > > > > > > > > the > > > > > > > > > > JavaServer > > > > > > > > > > shuts down. Do you know if there is any options from the > > > start > > > > () > > > > > > > > method > > > > > > > > > to > > > > > > > > > > do this? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Here is my code by the way, it is called from the main > java > > > > > > program. > > > > > > > > It > > > > > > > > > > just prints the > > > > > > > > > > two messages, nothing else seems to happen: > > > > > > > > > > > > > > > > > > > > import com.ptc.intralink.client.script.*; > > > > > > > > > > import com.ptc.intralink.script.*; > > > > > > > > > > > > > > > > > > > > public class Jserv extends ILIntralinkScript { > > > > > > > > > > ILIntralinkScriptInterface IL > > > > > > > > > > = (ILIntralinkScriptInterface)getScriptInterface(); > > > > > > > > > > > > > > > > > > > > private void run0 () throws Exception { > > > > > > > > > > // Begin: Added code > > > > > > > > > > JavaServer js = new JavaServer(); > > > > > > > > > > System.out.println("Before: Starting JavaServer"); > > > > > > > > > > js.start(); > > > > > > > > > > System.out.println("After: Starting JavaServer"); > > > > > > > > > > // End: Added code > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > public void run () throws Exception { > > > > > > > > > > run0 (); > > > > > > > > > > } > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks for your help, > > > > > > > > > > > > > > > > > > > > Marc > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > This is a PRIVATE message. If you are not the intended > > > > recipient, > > > > > > > > please > > > > > > > > > > delete without copying and kindly advise us by e-mail of > > the > > > > > > mistake > > > > > > > in > > > > > > > > > > delivery. NOTE: Regardless of content, this e-mail shall > > not > > > > > > operate > > > > > > > to > > > > > > > > > > bind CSC to any order or other contract unless pursuant > to > > > > > explicit > > > > > > > > > written > > > > > > > > > > agreement or government initiative expressly permitting > the > > > use > > > > > of > > > > > > > > e-mail > > > > > > > > > > for such purpose. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mark > > > > > > > > > > > > > > > > > > > @zzo.com To: > > Marc > > > C > > > > > > > > > Mettes/GIS/CSC@CSC > > > > > > > > > > cc: > > > > > > > > > > > > > > > > > > > 10/16/2003 12:11 Subject: > Re: > > > > > Java.pm > > > > > > > > > > > > > > > > > > > PM > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Oct 16, 2003 at 11:45:56AM -0400, Marc C Mettes > > > wrote: > > > > > > > > > > > > > > > > > > > > > > A few more (newbie java) questions: > > > > > > > > > > > > > > > > > > > > > > 1. Can I import() the JavaServer stuff into my java > code > > > and > > > > > then > > > > > > > > > > > call the start() method? It seems that main() > > doesn't > > > > > call > > > > > > > > start > > > > > > > > > (), > > > > > > > > > > > but has very similar code. The jar file would > need > > to > > > > be > > > > > in > > > > > > > the > > > > > > > > > > > CLASSPATH somewhere. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > yah put JavaServer.jar in yer classpath & call start() > > sounds > > > > > about > > > > > > > > right > > > > > > > > > - > > > > > > > > > > haven't tried it myself so I can't say for sure ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2. I probably would be able to use you JavaServer.jar > as > > is > > > > > > without > > > > > > > > > > > modifications, right? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > yes. > > > > > > > > > > > > > > > > > > > > > 3. Will this work with a 1.3.1 Sun JVM? > > > > > > > > > > > > > > > > > > > > > yes. > > > > > > > > > > > > > > > > > > > > you will need to get an object back to the perl side to > > > > actually > > > > > do > > > > > > > > > > anything - > > > > > > > > > > you might need to write an accessor function that returns > > the > > > > > > > top-level > > > > > > > > > > object > > > > > > > > > > - or whatever it is you need to control - & then on the > > perl > > > > side > > > > > > get > > > > > > > > > that > > > > > > > > > > object so you can manipulate your app. > > > > > > > > > > > > > > > > > > > > M > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Don T. <dt...@co...> - 2004-03-01 21:22:01
|
Hi, I did as you suggested. It seems the null Pointer Exception is giving the GEN0 error, but I get undefs on $self and $self->java before I get the last two errors (the ones that show up even in my other scripts). Thanks, ma...@zz... wrote: >Put some print statements in Java.pm at the beginning of the DESTROY >method (or run it thru the perl debugger) like: >sub DESTROY >{ > my($self) = shift; > print "BYE: $self $self->{java} $self->{name}\n"; > .... >} > >& see what turns up. >thanks, > M > >On Mon, Mar 01, 2004 at 03:20:06PM -0500, Don Tam wrote: > > >>Hi, >> >>I tried it with the modifications, to no avail. >>Actually, there is one extra error before the two I listed earlier: >> >> (in cleanup) Can't call method "send_command_and_get_response" >>on an und >>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640, <GEN0> >>line 181 >>during global destruction. >> >>The difference being the GEN0 part. >> >>Here is my modified subroutine: >> >>sub buildClassesArrayList($$) { >> my $hashRef = shift; >> my $targetArrayList = shift; >> >> for my $package (keys %{$hashRef}) { >> for my $class (keys %{$hashRef->{$package}}) { >> my $fullyQualifiedClassName = $package.".".$class; >> >>$targetArrayList->add($java->create_object($fullyQualifiedClassName)->getClass()); >> } >> } >>} >> >>ma...@zz... wrote: >> >> >> >>>Try this: >>> >>>@@ -57,8 +62,125 @@ sub buildClassesArrayList($$) { >>> for my $package (keys %{$hashRef}) { >>> for my $class (keys %{$hashRef->{$package}}) { >>> my $fullyQualifiedClassName = $package.".".$class; >>>- my $object = $java->create_object($fullyQualifiedClassName); >>>- $targetArrayList->add($object->getClass()); >>>+ >>>$targetArrayList->add($java->create_object($fullyQualifiedClassName); >>> } >>> } >>>} >>> >>>Basically get rid of that 'my $object' & just do the create straight into >>>the arry list add... maybe that is confusing the destructor... >>> M >>> >>>On Mon, Mar 01, 2004 at 02:44:29PM -0500, Don Tam wrote: >>> >>> >>> >>> >>>>Hi Mark, >>>> >>>>Here it is: >>>> >>>>#!/usr/local/bin/perl -w >>>> >>>>use strict; >>>>use Java; >>>> >>>>sub buildClassesArrayList($$); >>>> >>>>my $java = new Java(host=>'deathstar.consumercontact.com'); >>>> >>>>my %classes = ( >>>> 'com.cc.tss' => { >>>> 'TaskType' => 1, >>>> 'Task' => 1, >>>> 'PayRate' => 1, >>>> 'Province' => 1, >>>> 'PaySection' => 1, >>>> 'PayType' => 1, >>>> 'Location' => 1, >>>> 'Department' => 1, >>>> 'Title' => 1, >>>> 'Employee' => 1 >>>> }, >>>> 'com.cc.tss.approver' => { >>>> 'Role' => 1, >>>> 'ApproverType' => 1, >>>> 'ApproverLevel' => 1, >>>> 'Approver' => 1 >>>> } >>>>); >>>> >>>>my $session; >>>> >>>> >>>>eval { >>>> $session = $java->static_call("com.cc.HibernateApplicationUtil", >>>> "getSession"); >>>>}; >>>> >>>>if ($@) { >>>> $@ =~ s/^ERROR: //; >>>> $@ =~ s/at $0.*$//; >>>> >>>> if ($@ =~ /NullPointerException/) { >>>> my $arrayList = $java->create_object("java.util.ArrayList"); >>>> buildClassesArrayList(\%classes, $arrayList); >>>> my $path = `pwd`; >>>> chomp ($path); >>>> my $propertiesFileName = $path."/hibernate.properties"; >>>> $java->static_call("com.cc.HibernateApplicationUtil", >>>>"initConfiguration", $arrayList, $propertiesFileName); >>>> } >>>>} >>>> >>>>sub buildClassesArrayList($$) { >>>> my $hashRef = shift; >>>> my $targetArrayList = shift; >>>> >>>> for my $package (keys %{$hashRef}) { >>>> for my $class (keys %{$hashRef->{$package}}) { >>>> my $fullyQualifiedClassName = $package.".".$class; >>>> my $object = $java->create_object($fullyQualifiedClassName); >>>> $targetArrayList->add($object->getClass()); >>>> } >>>> } >>>>} >>>> >>>>I will continue to look at it as well. >>>> >>>>Thanks, >>>>Don. >>>> >>>>ma...@zz... wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Seems the object is somehow already getting cleaned up before the >>>>>global DESTROY gets called. >>>>>If you know what object is causing the problem you can undef it. >>>>>I will add a check to Java.pm for future releases too so this doesn't >>>>>happen. >>>>>If your script isn't too long I'll take a look at it - otherwise there >>>>>seems to be a mis-matched between creating and destroying of your >>>>>perl-created java objects. >>>>>Mark >>>>> >>>>> >>>>>On Mon, Mar 01, 2004 at 02:26:55PM -0500, Don Tam wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Hi, >>>>>> >>>>>>Thanks for the reply. I am running the latest Java.pm.. I just >>>>>>downloaded the 4.7 package on thursday (revision 1.3, it looks like). >>>>>> >>>>>>How would I avoid this? >>>>>> >>>>>>thanks, >>>>>>Don. >>>>>> >>>>>>ma...@zz... wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>Maybe a java object has already been destroy'ed before it went out >>>>>>>of scope/the program ended. >>>>>>>Java.pm tries to be smart & delete objects on the server-side when >>>>>>>they >>>>>>>go out of scope on the perl side. It's prolly not being smart enough. >>>>>>>What version of Java.pm are you running? >>>>>>>Mark >>>>>>> >>>>>>>On Mon, Mar 01, 2004 at 01:30:52PM -0500, Don Tam wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>>Hi, >>>>>>>> >>>>>>>>I keep getting this error, but the script seems to run fine: >>>>>>>> >>>>>>>>Use of uninitialized value in concatenation (.) or string at >>>>>>>>/usr/lib/perl5/site >>>>>>>>_perl/5.8.0/Java.pm line 640 during global destruction. >>>>>>>> (in cleanup) Can't call method "send_command_and_get_response" >>>>>>>>on an und >>>>>>>>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640 >>>>>>>>during global de >>>>>>>>struction. >>>>>>>> >>>>>>>>Anyone know what's going on? >>>>>>>> >>>>>>>>Thanks, >>>>>>>> >>>>>>>>-- >>>>>>>>Don Tam >>>>>>>>Software Developer >>>>>>>>(416)493-6111x177 >>>>>>>>dt...@co... >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>------------------------------------------------------- >>>>>>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. >>>>>>>>Build and deploy apps & Web services for Linux with >>>>>>>>a free DVD software kit from IBM. Click Now! >>>>>>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >>>>>>>>_______________________________________________ >>>>>>>>Javaserver-perl mailing list >>>>>>>>Jav...@li... >>>>>>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>-- >>>>>>Don Tam >>>>>>Software Developer >>>>>>(416)493-6111x177 >>>>>>dt...@co... >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>-- >>>>Don Tam >>>>Software Developer >>>>(416)493-6111x177 >>>>dt...@co... >>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. >>>>Build and deploy apps & Web services for Linux with >>>>a free DVD software kit from IBM. Click Now! >>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >>>>_______________________________________________ >>>>Javaserver-perl mailing list >>>>Jav...@li... >>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl >>>> >>>> >>>> >>>> >>-- >>Don Tam >>Software Developer >>(416)493-6111x177 >>dt...@co... >> >> >> >> >> -- Don Tam Software Developer (416)493-6111x177 dt...@co... |
From: <ma...@zz...> - 2004-03-01 20:45:47
|
Put some print statements in Java.pm at the beginning of the DESTROY method (or run it thru the perl debugger) like: sub DESTROY { my($self) = shift; print "BYE: $self $self->{java} $self->{name}\n"; .... } & see what turns up. thanks, M On Mon, Mar 01, 2004 at 03:20:06PM -0500, Don Tam wrote: > Hi, > > I tried it with the modifications, to no avail. > Actually, there is one extra error before the two I listed earlier: > > (in cleanup) Can't call method "send_command_and_get_response" > on an und > efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640, <GEN0> > line 181 > during global destruction. > > The difference being the GEN0 part. > > Here is my modified subroutine: > > sub buildClassesArrayList($$) { > my $hashRef = shift; > my $targetArrayList = shift; > > for my $package (keys %{$hashRef}) { > for my $class (keys %{$hashRef->{$package}}) { > my $fullyQualifiedClassName = $package.".".$class; > > $targetArrayList->add($java->create_object($fullyQualifiedClassName)->getClass()); > } > } > } > > ma...@zz... wrote: > > >Try this: > > > >@@ -57,8 +62,125 @@ sub buildClassesArrayList($$) { > > for my $package (keys %{$hashRef}) { > > for my $class (keys %{$hashRef->{$package}}) { > > my $fullyQualifiedClassName = $package.".".$class; > >- my $object = $java->create_object($fullyQualifiedClassName); > >- $targetArrayList->add($object->getClass()); > >+ > >$targetArrayList->add($java->create_object($fullyQualifiedClassName); > > } > > } > >} > > > >Basically get rid of that 'my $object' & just do the create straight into > >the arry list add... maybe that is confusing the destructor... > > M > > > >On Mon, Mar 01, 2004 at 02:44:29PM -0500, Don Tam wrote: > > > > > >>Hi Mark, > >> > >>Here it is: > >> > >>#!/usr/local/bin/perl -w > >> > >>use strict; > >>use Java; > >> > >>sub buildClassesArrayList($$); > >> > >>my $java = new Java(host=>'deathstar.consumercontact.com'); > >> > >>my %classes = ( > >> 'com.cc.tss' => { > >> 'TaskType' => 1, > >> 'Task' => 1, > >> 'PayRate' => 1, > >> 'Province' => 1, > >> 'PaySection' => 1, > >> 'PayType' => 1, > >> 'Location' => 1, > >> 'Department' => 1, > >> 'Title' => 1, > >> 'Employee' => 1 > >> }, > >> 'com.cc.tss.approver' => { > >> 'Role' => 1, > >> 'ApproverType' => 1, > >> 'ApproverLevel' => 1, > >> 'Approver' => 1 > >> } > >>); > >> > >>my $session; > >> > >> > >>eval { > >> $session = $java->static_call("com.cc.HibernateApplicationUtil", > >> "getSession"); > >>}; > >> > >>if ($@) { > >> $@ =~ s/^ERROR: //; > >> $@ =~ s/at $0.*$//; > >> > >> if ($@ =~ /NullPointerException/) { > >> my $arrayList = $java->create_object("java.util.ArrayList"); > >> buildClassesArrayList(\%classes, $arrayList); > >> my $path = `pwd`; > >> chomp ($path); > >> my $propertiesFileName = $path."/hibernate.properties"; > >> $java->static_call("com.cc.HibernateApplicationUtil", > >>"initConfiguration", $arrayList, $propertiesFileName); > >> } > >>} > >> > >>sub buildClassesArrayList($$) { > >> my $hashRef = shift; > >> my $targetArrayList = shift; > >> > >> for my $package (keys %{$hashRef}) { > >> for my $class (keys %{$hashRef->{$package}}) { > >> my $fullyQualifiedClassName = $package.".".$class; > >> my $object = $java->create_object($fullyQualifiedClassName); > >> $targetArrayList->add($object->getClass()); > >> } > >> } > >>} > >> > >>I will continue to look at it as well. > >> > >>Thanks, > >>Don. > >> > >>ma...@zz... wrote: > >> > >> > >> > >>>Seems the object is somehow already getting cleaned up before the > >>>global DESTROY gets called. > >>>If you know what object is causing the problem you can undef it. > >>>I will add a check to Java.pm for future releases too so this doesn't > >>>happen. > >>>If your script isn't too long I'll take a look at it - otherwise there > >>>seems to be a mis-matched between creating and destroying of your > >>>perl-created java objects. > >>> Mark > >>> > >>> > >>>On Mon, Mar 01, 2004 at 02:26:55PM -0500, Don Tam wrote: > >>> > >>> > >>> > >>> > >>>>Hi, > >>>> > >>>>Thanks for the reply. I am running the latest Java.pm.. I just > >>>>downloaded the 4.7 package on thursday (revision 1.3, it looks like). > >>>> > >>>>How would I avoid this? > >>>> > >>>>thanks, > >>>>Don. > >>>> > >>>>ma...@zz... wrote: > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>>Maybe a java object has already been destroy'ed before it went out > >>>>>of scope/the program ended. > >>>>>Java.pm tries to be smart & delete objects on the server-side when > >>>>>they > >>>>>go out of scope on the perl side. It's prolly not being smart enough. > >>>>>What version of Java.pm are you running? > >>>>>Mark > >>>>> > >>>>>On Mon, Mar 01, 2004 at 01:30:52PM -0500, Don Tam wrote: > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>>Hi, > >>>>>> > >>>>>>I keep getting this error, but the script seems to run fine: > >>>>>> > >>>>>>Use of uninitialized value in concatenation (.) or string at > >>>>>>/usr/lib/perl5/site > >>>>>>_perl/5.8.0/Java.pm line 640 during global destruction. > >>>>>> (in cleanup) Can't call method "send_command_and_get_response" > >>>>>>on an und > >>>>>>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640 > >>>>>>during global de > >>>>>>struction. > >>>>>> > >>>>>>Anyone know what's going on? > >>>>>> > >>>>>>Thanks, > >>>>>> > >>>>>>-- > >>>>>>Don Tam > >>>>>>Software Developer > >>>>>>(416)493-6111x177 > >>>>>>dt...@co... > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>>------------------------------------------------------- > >>>>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >>>>>>Build and deploy apps & Web services for Linux with > >>>>>>a free DVD software kit from IBM. Click Now! > >>>>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >>>>>>_______________________________________________ > >>>>>>Javaserver-perl mailing list > >>>>>>Jav...@li... > >>>>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>-- > >>>>Don Tam > >>>>Software Developer > >>>>(416)493-6111x177 > >>>>dt...@co... > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>-- > >>Don Tam > >>Software Developer > >>(416)493-6111x177 > >>dt...@co... > >> > >> > >> > >> > >> > >>------------------------------------------------------- > >>SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >>Build and deploy apps & Web services for Linux with > >>a free DVD software kit from IBM. Click Now! > >>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >>_______________________________________________ > >>Javaserver-perl mailing list > >>Jav...@li... > >>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > >> > >> > > -- > Don Tam > Software Developer > (416)493-6111x177 > dt...@co... > > > |
From: Don T. <dt...@co...> - 2004-03-01 20:32:29
|
Hi, I tried it with the modifications, to no avail. Actually, there is one extra error before the two I listed earlier: (in cleanup) Can't call method "send_command_and_get_response" on an und efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640, <GEN0> line 181 during global destruction. The difference being the GEN0 part. Here is my modified subroutine: sub buildClassesArrayList($$) { my $hashRef = shift; my $targetArrayList = shift; for my $package (keys %{$hashRef}) { for my $class (keys %{$hashRef->{$package}}) { my $fullyQualifiedClassName = $package.".".$class; $targetArrayList->add($java->create_object($fullyQualifiedClassName)->getClass()); } } } ma...@zz... wrote: >Try this: > >@@ -57,8 +62,125 @@ sub buildClassesArrayList($$) { > for my $package (keys %{$hashRef}) { > for my $class (keys %{$hashRef->{$package}}) { > my $fullyQualifiedClassName = $package.".".$class; >- my $object = $java->create_object($fullyQualifiedClassName); >- $targetArrayList->add($object->getClass()); >+ $targetArrayList->add($java->create_object($fullyQualifiedClassName); > } > } > } > >Basically get rid of that 'my $object' & just do the create straight into >the arry list add... maybe that is confusing the destructor... > M > >On Mon, Mar 01, 2004 at 02:44:29PM -0500, Don Tam wrote: > > >>Hi Mark, >> >>Here it is: >> >>#!/usr/local/bin/perl -w >> >>use strict; >>use Java; >> >>sub buildClassesArrayList($$); >> >>my $java = new Java(host=>'deathstar.consumercontact.com'); >> >>my %classes = ( >> 'com.cc.tss' => { >> 'TaskType' => 1, >> 'Task' => 1, >> 'PayRate' => 1, >> 'Province' => 1, >> 'PaySection' => 1, >> 'PayType' => 1, >> 'Location' => 1, >> 'Department' => 1, >> 'Title' => 1, >> 'Employee' => 1 >> }, >> 'com.cc.tss.approver' => { >> 'Role' => 1, >> 'ApproverType' => 1, >> 'ApproverLevel' => 1, >> 'Approver' => 1 >> } >>); >> >>my $session; >> >> >>eval { >> $session = $java->static_call("com.cc.HibernateApplicationUtil", >> "getSession"); >>}; >> >>if ($@) { >> $@ =~ s/^ERROR: //; >> $@ =~ s/at $0.*$//; >> >> if ($@ =~ /NullPointerException/) { >> my $arrayList = $java->create_object("java.util.ArrayList"); >> buildClassesArrayList(\%classes, $arrayList); >> my $path = `pwd`; >> chomp ($path); >> my $propertiesFileName = $path."/hibernate.properties"; >> $java->static_call("com.cc.HibernateApplicationUtil", >>"initConfiguration", $arrayList, $propertiesFileName); >> } >>} >> >>sub buildClassesArrayList($$) { >> my $hashRef = shift; >> my $targetArrayList = shift; >> >> for my $package (keys %{$hashRef}) { >> for my $class (keys %{$hashRef->{$package}}) { >> my $fullyQualifiedClassName = $package.".".$class; >> my $object = $java->create_object($fullyQualifiedClassName); >> $targetArrayList->add($object->getClass()); >> } >> } >>} >> >>I will continue to look at it as well. >> >>Thanks, >>Don. >> >>ma...@zz... wrote: >> >> >> >>>Seems the object is somehow already getting cleaned up before the >>>global DESTROY gets called. >>>If you know what object is causing the problem you can undef it. >>>I will add a check to Java.pm for future releases too so this doesn't >>>happen. >>>If your script isn't too long I'll take a look at it - otherwise there >>>seems to be a mis-matched between creating and destroying of your >>>perl-created java objects. >>> Mark >>> >>> >>>On Mon, Mar 01, 2004 at 02:26:55PM -0500, Don Tam wrote: >>> >>> >>> >>> >>>>Hi, >>>> >>>>Thanks for the reply. I am running the latest Java.pm.. I just >>>>downloaded the 4.7 package on thursday (revision 1.3, it looks like). >>>> >>>>How would I avoid this? >>>> >>>>thanks, >>>>Don. >>>> >>>>ma...@zz... wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Maybe a java object has already been destroy'ed before it went out >>>>>of scope/the program ended. >>>>>Java.pm tries to be smart & delete objects on the server-side when they >>>>>go out of scope on the perl side. It's prolly not being smart enough. >>>>>What version of Java.pm are you running? >>>>>Mark >>>>> >>>>>On Mon, Mar 01, 2004 at 01:30:52PM -0500, Don Tam wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Hi, >>>>>> >>>>>>I keep getting this error, but the script seems to run fine: >>>>>> >>>>>>Use of uninitialized value in concatenation (.) or string at >>>>>>/usr/lib/perl5/site >>>>>>_perl/5.8.0/Java.pm line 640 during global destruction. >>>>>> (in cleanup) Can't call method "send_command_and_get_response" >>>>>>on an und >>>>>>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640 during >>>>>>global de >>>>>>struction. >>>>>> >>>>>>Anyone know what's going on? >>>>>> >>>>>>Thanks, >>>>>> >>>>>>-- >>>>>>Don Tam >>>>>>Software Developer >>>>>>(416)493-6111x177 >>>>>>dt...@co... >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>------------------------------------------------------- >>>>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. >>>>>>Build and deploy apps & Web services for Linux with >>>>>>a free DVD software kit from IBM. Click Now! >>>>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >>>>>>_______________________________________________ >>>>>>Javaserver-perl mailing list >>>>>>Jav...@li... >>>>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>-- >>>>Don Tam >>>>Software Developer >>>>(416)493-6111x177 >>>>dt...@co... >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>-- >>Don Tam >>Software Developer >>(416)493-6111x177 >>dt...@co... >> >> >> >> >> >>------------------------------------------------------- >>SF.Net is sponsored by: Speed Start Your Linux Apps Now. >>Build and deploy apps & Web services for Linux with >>a free DVD software kit from IBM. Click Now! >>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >>_______________________________________________ >>Javaserver-perl mailing list >>Jav...@li... >>https://lists.sourceforge.net/lists/listinfo/javaserver-perl >> >> -- Don Tam Software Developer (416)493-6111x177 dt...@co... |
From: <ma...@zz...> - 2004-03-01 20:14:52
|
Try this: @@ -57,8 +62,125 @@ sub buildClassesArrayList($$) { for my $package (keys %{$hashRef}) { for my $class (keys %{$hashRef->{$package}}) { my $fullyQualifiedClassName = $package.".".$class; - my $object = $java->create_object($fullyQualifiedClassName); - $targetArrayList->add($object->getClass()); + $targetArrayList->add($java->create_object($fullyQualifiedClassName); } } } Basically get rid of that 'my $object' & just do the create straight into the arry list add... maybe that is confusing the destructor... M On Mon, Mar 01, 2004 at 02:44:29PM -0500, Don Tam wrote: > Hi Mark, > > Here it is: > > #!/usr/local/bin/perl -w > > use strict; > use Java; > > sub buildClassesArrayList($$); > > my $java = new Java(host=>'deathstar.consumercontact.com'); > > my %classes = ( > 'com.cc.tss' => { > 'TaskType' => 1, > 'Task' => 1, > 'PayRate' => 1, > 'Province' => 1, > 'PaySection' => 1, > 'PayType' => 1, > 'Location' => 1, > 'Department' => 1, > 'Title' => 1, > 'Employee' => 1 > }, > 'com.cc.tss.approver' => { > 'Role' => 1, > 'ApproverType' => 1, > 'ApproverLevel' => 1, > 'Approver' => 1 > } > ); > > my $session; > > > eval { > $session = $java->static_call("com.cc.HibernateApplicationUtil", > "getSession"); > }; > > if ($@) { > $@ =~ s/^ERROR: //; > $@ =~ s/at $0.*$//; > > if ($@ =~ /NullPointerException/) { > my $arrayList = $java->create_object("java.util.ArrayList"); > buildClassesArrayList(\%classes, $arrayList); > my $path = `pwd`; > chomp ($path); > my $propertiesFileName = $path."/hibernate.properties"; > $java->static_call("com.cc.HibernateApplicationUtil", > "initConfiguration", $arrayList, $propertiesFileName); > } > } > > sub buildClassesArrayList($$) { > my $hashRef = shift; > my $targetArrayList = shift; > > for my $package (keys %{$hashRef}) { > for my $class (keys %{$hashRef->{$package}}) { > my $fullyQualifiedClassName = $package.".".$class; > my $object = $java->create_object($fullyQualifiedClassName); > $targetArrayList->add($object->getClass()); > } > } > } > > I will continue to look at it as well. > > Thanks, > Don. > > ma...@zz... wrote: > > >Seems the object is somehow already getting cleaned up before the > >global DESTROY gets called. > >If you know what object is causing the problem you can undef it. > >I will add a check to Java.pm for future releases too so this doesn't > >happen. > >If your script isn't too long I'll take a look at it - otherwise there > >seems to be a mis-matched between creating and destroying of your > >perl-created java objects. > > Mark > > > > > >On Mon, Mar 01, 2004 at 02:26:55PM -0500, Don Tam wrote: > > > > > >>Hi, > >> > >>Thanks for the reply. I am running the latest Java.pm.. I just > >>downloaded the 4.7 package on thursday (revision 1.3, it looks like). > >> > >>How would I avoid this? > >> > >>thanks, > >>Don. > >> > >>ma...@zz... wrote: > >> > >> > >> > >>>Maybe a java object has already been destroy'ed before it went out > >>>of scope/the program ended. > >>>Java.pm tries to be smart & delete objects on the server-side when they > >>>go out of scope on the perl side. It's prolly not being smart enough. > >>>What version of Java.pm are you running? > >>> Mark > >>> > >>>On Mon, Mar 01, 2004 at 01:30:52PM -0500, Don Tam wrote: > >>> > >>> > >>> > >>> > >>>>Hi, > >>>> > >>>>I keep getting this error, but the script seems to run fine: > >>>> > >>>>Use of uninitialized value in concatenation (.) or string at > >>>>/usr/lib/perl5/site > >>>>_perl/5.8.0/Java.pm line 640 during global destruction. > >>>> (in cleanup) Can't call method "send_command_and_get_response" > >>>>on an und > >>>>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640 during > >>>>global de > >>>>struction. > >>>> > >>>>Anyone know what's going on? > >>>> > >>>>Thanks, > >>>> > >>>>-- > >>>>Don Tam > >>>>Software Developer > >>>>(416)493-6111x177 > >>>>dt...@co... > >>>> > >>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >>>>Build and deploy apps & Web services for Linux with > >>>>a free DVD software kit from IBM. Click Now! > >>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >>>>_______________________________________________ > >>>>Javaserver-perl mailing list > >>>>Jav...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > >>>> > >>>> > >>>> > >>>> > >>-- > >>Don Tam > >>Software Developer > >>(416)493-6111x177 > >>dt...@co... > >> > >> > >> > >> > >> > > -- > Don Tam > Software Developer > (416)493-6111x177 > dt...@co... > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-03-01 20:11:31
|
Does the complaining only happen when you get the NullPointer & you create the ArrayList? M On Mon, Mar 01, 2004 at 02:44:29PM -0500, Don Tam wrote: > Hi Mark, > > Here it is: > > #!/usr/local/bin/perl -w > > use strict; > use Java; > > sub buildClassesArrayList($$); > > my $java = new Java(host=>'deathstar.consumercontact.com'); > > my %classes = ( > 'com.cc.tss' => { > 'TaskType' => 1, > 'Task' => 1, > 'PayRate' => 1, > 'Province' => 1, > 'PaySection' => 1, > 'PayType' => 1, > 'Location' => 1, > 'Department' => 1, > 'Title' => 1, > 'Employee' => 1 > }, > 'com.cc.tss.approver' => { > 'Role' => 1, > 'ApproverType' => 1, > 'ApproverLevel' => 1, > 'Approver' => 1 > } > ); > > my $session; > > > eval { > $session = $java->static_call("com.cc.HibernateApplicationUtil", > "getSession"); > }; > > if ($@) { > $@ =~ s/^ERROR: //; > $@ =~ s/at $0.*$//; > > if ($@ =~ /NullPointerException/) { > my $arrayList = $java->create_object("java.util.ArrayList"); > buildClassesArrayList(\%classes, $arrayList); > my $path = `pwd`; > chomp ($path); > my $propertiesFileName = $path."/hibernate.properties"; > $java->static_call("com.cc.HibernateApplicationUtil", > "initConfiguration", $arrayList, $propertiesFileName); > } > } > > sub buildClassesArrayList($$) { > my $hashRef = shift; > my $targetArrayList = shift; > > for my $package (keys %{$hashRef}) { > for my $class (keys %{$hashRef->{$package}}) { > my $fullyQualifiedClassName = $package.".".$class; > my $object = $java->create_object($fullyQualifiedClassName); > $targetArrayList->add($object->getClass()); > } > } > } > > I will continue to look at it as well. > > Thanks, > Don. > > ma...@zz... wrote: > > >Seems the object is somehow already getting cleaned up before the > >global DESTROY gets called. > >If you know what object is causing the problem you can undef it. > >I will add a check to Java.pm for future releases too so this doesn't > >happen. > >If your script isn't too long I'll take a look at it - otherwise there > >seems to be a mis-matched between creating and destroying of your > >perl-created java objects. > > Mark > > > > > >On Mon, Mar 01, 2004 at 02:26:55PM -0500, Don Tam wrote: > > > > > >>Hi, > >> > >>Thanks for the reply. I am running the latest Java.pm.. I just > >>downloaded the 4.7 package on thursday (revision 1.3, it looks like). > >> > >>How would I avoid this? > >> > >>thanks, > >>Don. > >> > >>ma...@zz... wrote: > >> > >> > >> > >>>Maybe a java object has already been destroy'ed before it went out > >>>of scope/the program ended. > >>>Java.pm tries to be smart & delete objects on the server-side when they > >>>go out of scope on the perl side. It's prolly not being smart enough. > >>>What version of Java.pm are you running? > >>> Mark > >>> > >>>On Mon, Mar 01, 2004 at 01:30:52PM -0500, Don Tam wrote: > >>> > >>> > >>> > >>> > >>>>Hi, > >>>> > >>>>I keep getting this error, but the script seems to run fine: > >>>> > >>>>Use of uninitialized value in concatenation (.) or string at > >>>>/usr/lib/perl5/site > >>>>_perl/5.8.0/Java.pm line 640 during global destruction. > >>>> (in cleanup) Can't call method "send_command_and_get_response" > >>>>on an und > >>>>efined value at /usr/lib/perl5/site_perl/5.8.0/Java.pm line 640 during > >>>>global de > >>>>struction. > >>>> > >>>>Anyone know what's going on? > >>>> > >>>>Thanks, > >>>> > >>>>-- > >>>>Don Tam > >>>>Software Developer > >>>>(416)493-6111x177 > >>>>dt...@co... > >>>> > >>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >>>>Build and deploy apps & Web services for Linux with > >>>>a free DVD software kit from IBM. Click Now! > >>>>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >>>>_______________________________________________ > >>>>Javaserver-perl mailing list > >>>>Jav...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > >>>> > >>>> > >>>> > >>>> > >>-- > >>Don Tam > >>Software Developer > >>(416)493-6111x177 > >>dt...@co... > >> > >> > >> > >> > >> > > -- > Don Tam > Software Developer > (416)493-6111x177 > dt...@co... > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |