javaserver-perl Mailing List for JavaServer (Page 2)
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: Don T. <dt...@co...> - 2004-03-01 19:56:49
|
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... |
From: <ma...@zz...> - 2004-03-01 19:54:24
|
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... > > > |
From: Don T. <dt...@co...> - 2004-03-01 19:39:15
|
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... |
From: <ma...@zz...> - 2004-03-01 19:30:17
|
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 |
From: Don T. <dt...@co...> - 2004-03-01 18:43:10
|
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... |
From: <ma...@zz...> - 2004-02-27 20:18:52
|
First please address JavaServer questions to the list. Please join the list to post. Ok. I have -no- idea what you're trying to do. I have never heard of 'Hibernate' - regardless first you need to start JavaServer (the java stuff) with the Hibernate jars in your classpath. Then in your perl program you create the 'java' object ($java = new Java;) & then you can create Java objects & call their functions. In your case you're trying to pass a Class object to a function - which you get via the 'getClass()' function call in Object. it'll look something like: my $java = new Java; my $cfg = $java->create_object("some.Hibernate.class"); my $obj = $java->create_object("eg.Vertex"); $cfg->addClass($obj->getClass); Mark ----- Forwarded message from don tam <sew...@us...> ----- Delivered-To: ma...@zz... Return-Path: sew...@us... Received: from mail.sourceforge.net (lists.sourceforge.net [66.35.250.206]) (TLS: TLSv1/SSLv3,168bits,DES-CBC3-SHA) by zzo.com with esmtp; Fri, 27 Feb 2004 11:32:23 -0800 Received: from sc8-sf-sshgate.sourceforge.net ([66.35.250.220]) by sc8-sf-mx2.sourceforge.net with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1AwnPg-0006LQ-Jw for zz...@us...; Fri, 27 Feb 2004 11:12:44 -0800 Received: from sc8-sf-web3-b.sourceforge.net ([10.3.1.23] helo=sc8-sf-web3.sourceforge.net) by sc8-sf-sshgate.sourceforge.net with esmtp (Exim 3.36 #1 (Debian)) id 1AwneX-0007OP-00 for <zz...@us...>; Fri, 27 Feb 2004 11:28:05 -0800 Received: from nobody by sc8-sf-web3.sourceforge.net with local (Exim 3.36 #1 (Debian)) id 1AwneW-00038B-00 for <zz...@us...>; Fri, 27 Feb 2004 11:28:04 -0800 To: zz...@us... Subject: javaServer/Java module From: don tam <sew...@us...> Message-Id: <E1A...@sc...> Date: Fri, 27 Feb 2004 11:28:04 -0800 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.13.7.3 Hi, I am trying to get Hibernate to work with your product. However, I am having trouble passing a class to a certain function. For example, cfg.addClass(eg.Vertex.class); I've tried cfg.addClass("eg.Vertex.class"); but it doesn't work. Any advice? Is this even possible? Thanks, Don Tam. ----- End forwarded message ----- |
From: <ma...@zz...> - 2004-02-25 18:01:51
|
Howdy all, Just letting everyone know I've released a new version of JavaServer. Perl stuff is now at 4.7 & Java stuff at 5.1. Available at all the usual places (CPAN, javaserver.sf.net)... enjoy, Mark Big thanks to Dave & Crew at Permabit for most of the Java-side changes! Java 5.1 - added logging framework/better logging - will use Log4J if available otherwise my dumbed down one - easier to run JavaServer either in standalone mode or integrated into another app - Shutdownable interface to kill of threads - fixes to get protected/private fields/functions Perl 4.7 - updated examples to use lib '..' & use com.zzo.javaserver package when instantiating Test classes - add 'destroy' method for hand destroying objects |
From: Patrick W. X. I. S. <pat...@xp...> - 2004-02-08 17:47:41
|
Hi Mark, My cheeks couldn't be more red ;-) I overlooked the most obvious. (And, yes, I confirmed the subscription...) Thanks again, Patrick -----Original Message----- From: jav...@li... [mailto:jav...@li...] On Behalf Of ma...@zz... Sent: Saturday, 07 February, 2004 16:39 To: Patrick Wever, XPOS Internet Solutions Cc: jav...@li... Subject: [Javaserver-perl] Re: Mark, sent this to the sourceforge list, but it didn't show up there... The valid range of a 'byte' in Java is -128 to +127... Did you confirm your subscription to the list - souceforge should have emailed you a confirm email that you had to reply to to become a member of the list. Mark On Sat, Feb 07, 2004 at 09:42:18AM +0100, Patrick Wever, XPOS Internet Solutions wrote: > Dear Mark, > > Still unable to get the array working: > > I've the following method to convert a string of 32 hex characters > into 16 byte values. > > sub hexstring2array > { > my ($array, $string) = @_; > > my @hexarray = split(//, $string); > my $j = 0; > my $i = 0; > while ($i < @hexarray) { > my $byte = hex($hexarray[$i++].$hexarray[$i++]); > $array->[$j++] = "$byte:byte"; > } > } > > Calling hexstring2array($array, $string), with > > $array = $java->create_array('byte', 16); > $string = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; > > the assignment > > $array->[$j++] = "$byte:byte"; > > results in the error > > ERROR: java.lang.NumberFormatException: Value out of range. > Value:"170" Radix:10 at lib/JavaArray.pm line 28 > > (170 is decimal for 0xAA) > > Could it be that 170 is treated as a string? (Because Value is quoted, > and Radix not...?) > > Thanks in advance! > > Patrick > ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Javaserver-perl mailing list Jav...@li... https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-02-07 16:08:00
|
The valid range of a 'byte' in Java is -128 to +127... Did you confirm your subscription to the list - souceforge should have emailed you a confirm email that you had to reply to to become a member of the list. Mark On Sat, Feb 07, 2004 at 09:42:18AM +0100, Patrick Wever, XPOS Internet Solutions wrote: > Dear Mark, > > Still unable to get the array working: > > I've the following method to convert a string of 32 hex characters into > 16 > byte values. > > sub hexstring2array > { > my ($array, $string) = @_; > > my @hexarray = split(//, $string); > my $j = 0; > my $i = 0; > while ($i < @hexarray) { > my $byte = hex($hexarray[$i++].$hexarray[$i++]); > $array->[$j++] = "$byte:byte"; > } > } > > Calling hexstring2array($array, $string), with > > $array = $java->create_array('byte', 16); > $string = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; > > the assignment > > $array->[$j++] = "$byte:byte"; > > results in the error > > ERROR: java.lang.NumberFormatException: Value out of range. > Value:"170" Radix:10 at lib/JavaArray.pm line 28 > > (170 is decimal for 0xAA) > > Could it be that 170 is treated as a string? (Because Value is quoted, > and > Radix not...?) > > Thanks in advance! > > Patrick > |
From: <ma...@zz...> - 2004-02-04 22:23:55
|
Yah you need a primitive 'byte' array NOT the wrapper object Byte (java.lang.Byte) - create your array like: $array = $java->create_array("byte", 16); & hopefully that'll do it. Mark PS Note I cc'ed the mailing list for this kinda thing - please email to the list in the future... thanks!! You can subscribe to the list at the sourceforge site. On Wed, Feb 04, 2004 at 07:41:16PM +0100, Patrick Wever, XPOS Internet Solutions wrote: > Hi Mark, > > Ran into a 'problem': > > I have to call a method on the java side that is declared as follows: > > boolean SetKey(byte[] key); > > The byte array should be 16 bytes long. > > In Perl I do the following: > > my $object = $java->create_object('<dotted classpath>'); > > my $array = $java->create_array("java.lang.Byte", 16); > > (in a loop, 16 times) > $array->[$i] = "$byte:byte"; > > $object->SetKey($array); > > The SetKey fails with some type mismatch error (sorry, forgot to write > down exact error, have it tomorrow...) > > Any light on this? > > With kind regards, > > Patrick > |
From: <ma...@zz...> - 2004-02-04 20:23:04
|
Oh I can put the check for AWT in the java stuff HOWEVER you can just turn off the event listener stuff via perl like: $java = new Java(event_port => -1); Mark On Wed, Feb 04, 2004 at 11:37:28AM -0800, ma...@zz... wrote: > If Swing support is not available in your JRE then it won't be in > JavaServer, you don't have to do anything special. > However JavaServer -does- assume the AWT is present - maybe it should > be more careful about that - is it even possible to get a JRE w/o AWT?? - > yah prolly is - an embedded JVM or something perhaps. > I fix that in the next release. > thanks, > Mark > > On Wed, Feb 04, 2004 at 09:16:15AM -1000, Kevin W. English wrote: > > yeah, my bad. I googled the error and found out it was a missing > > library. once the sysdmin installed the X11 libraries, it worked fine. > > > > Is there a way to compile the java server without awt/Swing support? > > > > kevin > > > > ma...@zz... wrote: > > > > >Can you run any java program on this machine? > > >Either the wrong version of the JRE was installed for the > > >machine's actual archetecture or OS-version or the JRE was compiled > > >on one box & copied to this one. > > >OR yer LD_LIBRARY_PATH is incorrect - that libaray should be in > > >/usr/X11R6/lib or thereabouts - check your ld.conf & whereever that > > >library is add that directory. > > >I'm not exactly sure what that library is but it comes with X. > > > Mark > > > > > >On Tue, Feb 03, 2004 at 06:26:13PM -1000, Kevin W. English wrote: > > > > > > > > >>just installed on a new box but i'm getting this: > > >> > > >> > > >>java.lang.UnsatisfiedLinkError: > > >>/usr/local/j2sdk1.4.2_03/jre/lib/i386/libawt.so: libXp.so.6: cannot open > > >>shared object file: No such file or directory > > >> at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > >> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) > > >> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) > > >> at java.lang.Runtime.loadLibrary0(Runtime.java:788) > > >> at java.lang.System.loadLibrary(System.java:834) > > >> at > > >>sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) > > >> at java.security.AccessController.doPrivileged(Native Method) > > >> at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) > > >> at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) > > >> at java.awt.Component.<clinit>(Component.java:506) > > >> at java.lang.Class.forName0(Native Method) > > >> at java.lang.Class.forName(Class.java:141) > > >> at com.zzo.javaserver.Dealer.<init>(Dealer.java:369) > > >> at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:165) > > >> at com.zzo.javaserver.TCPServer.run(TCPServer.java:143) > > >> at java.lang.Thread.run(Thread.java:534) > > >> > > >> > > >> > > >>------------------------------------------------------- > > >>The SF.Net email is sponsored by EclipseCon 2004 > > >>Premiere Conference on Open Tools Development and Integration > > >>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > >>http://www.eclipsecon.org/osdn > > >>_______________________________________________ > > >>Javaserver-perl mailing list > > >>Jav...@li... > > >>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > >> > > >> > > > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by EclipseCon 2004 > > Premiere Conference on Open Tools Development and Integration > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > http://www.eclipsecon.org/osdn > > _______________________________________________ > > Javaserver-perl mailing list > > Jav...@li... > > https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: <ma...@zz...> - 2004-02-04 19:36:14
|
If Swing support is not available in your JRE then it won't be in JavaServer, you don't have to do anything special. However JavaServer -does- assume the AWT is present - maybe it should be more careful about that - is it even possible to get a JRE w/o AWT?? - yah prolly is - an embedded JVM or something perhaps. I fix that in the next release. thanks, Mark On Wed, Feb 04, 2004 at 09:16:15AM -1000, Kevin W. English wrote: > yeah, my bad. I googled the error and found out it was a missing > library. once the sysdmin installed the X11 libraries, it worked fine. > > Is there a way to compile the java server without awt/Swing support? > > kevin > > ma...@zz... wrote: > > >Can you run any java program on this machine? > >Either the wrong version of the JRE was installed for the > >machine's actual archetecture or OS-version or the JRE was compiled > >on one box & copied to this one. > >OR yer LD_LIBRARY_PATH is incorrect - that libaray should be in > >/usr/X11R6/lib or thereabouts - check your ld.conf & whereever that > >library is add that directory. > >I'm not exactly sure what that library is but it comes with X. > > Mark > > > >On Tue, Feb 03, 2004 at 06:26:13PM -1000, Kevin W. English wrote: > > > > > >>just installed on a new box but i'm getting this: > >> > >> > >>java.lang.UnsatisfiedLinkError: > >>/usr/local/j2sdk1.4.2_03/jre/lib/i386/libawt.so: libXp.so.6: cannot open > >>shared object file: No such file or directory > >> at java.lang.ClassLoader$NativeLibrary.load(Native Method) > >> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) > >> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) > >> at java.lang.Runtime.loadLibrary0(Runtime.java:788) > >> at java.lang.System.loadLibrary(System.java:834) > >> at > >>sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) > >> at java.security.AccessController.doPrivileged(Native Method) > >> at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) > >> at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) > >> at java.awt.Component.<clinit>(Component.java:506) > >> at java.lang.Class.forName0(Native Method) > >> at java.lang.Class.forName(Class.java:141) > >> at com.zzo.javaserver.Dealer.<init>(Dealer.java:369) > >> at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:165) > >> at com.zzo.javaserver.TCPServer.run(TCPServer.java:143) > >> at java.lang.Thread.run(Thread.java:534) > >> > >> > >> > >>------------------------------------------------------- > >>The SF.Net email is sponsored by EclipseCon 2004 > >>Premiere Conference on Open Tools Development and Integration > >>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > >>http://www.eclipsecon.org/osdn > >>_______________________________________________ > >>Javaserver-perl mailing list > >>Jav...@li... > >>https://lists.sourceforge.net/lists/listinfo/javaserver-perl > >> > >> > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: Kevin W. E. <ken...@ho...> - 2004-02-04 19:17:32
|
yeah, my bad. I googled the error and found out it was a missing library. once the sysdmin installed the X11 libraries, it worked fine. Is there a way to compile the java server without awt/Swing support? kevin ma...@zz... wrote: >Can you run any java program on this machine? >Either the wrong version of the JRE was installed for the >machine's actual archetecture or OS-version or the JRE was compiled >on one box & copied to this one. >OR yer LD_LIBRARY_PATH is incorrect - that libaray should be in >/usr/X11R6/lib or thereabouts - check your ld.conf & whereever that >library is add that directory. >I'm not exactly sure what that library is but it comes with X. > Mark > >On Tue, Feb 03, 2004 at 06:26:13PM -1000, Kevin W. English wrote: > > >>just installed on a new box but i'm getting this: >> >> >>java.lang.UnsatisfiedLinkError: >>/usr/local/j2sdk1.4.2_03/jre/lib/i386/libawt.so: libXp.so.6: cannot open >>shared object file: No such file or directory >> at java.lang.ClassLoader$NativeLibrary.load(Native Method) >> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) >> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) >> at java.lang.Runtime.loadLibrary0(Runtime.java:788) >> at java.lang.System.loadLibrary(System.java:834) >> at >>sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) >> at java.security.AccessController.doPrivileged(Native Method) >> at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) >> at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) >> at java.awt.Component.<clinit>(Component.java:506) >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:141) >> at com.zzo.javaserver.Dealer.<init>(Dealer.java:369) >> at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:165) >> at com.zzo.javaserver.TCPServer.run(TCPServer.java:143) >> at java.lang.Thread.run(Thread.java:534) >> >> >> >>------------------------------------------------------- >>The SF.Net email is sponsored by EclipseCon 2004 >>Premiere Conference on Open Tools Development and Integration >>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >>http://www.eclipsecon.org/osdn >>_______________________________________________ >>Javaserver-perl mailing list >>Jav...@li... >>https://lists.sourceforge.net/lists/listinfo/javaserver-perl >> >> |
From: <ma...@zz...> - 2004-02-04 07:10:19
|
Can you run any java program on this machine? Either the wrong version of the JRE was installed for the machine's actual archetecture or OS-version or the JRE was compiled on one box & copied to this one. OR yer LD_LIBRARY_PATH is incorrect - that libaray should be in /usr/X11R6/lib or thereabouts - check your ld.conf & whereever that library is add that directory. I'm not exactly sure what that library is but it comes with X. Mark On Tue, Feb 03, 2004 at 06:26:13PM -1000, Kevin W. English wrote: > > just installed on a new box but i'm getting this: > > > java.lang.UnsatisfiedLinkError: > /usr/local/j2sdk1.4.2_03/jre/lib/i386/libawt.so: libXp.so.6: cannot open > shared object file: No such file or directory > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > at java.lang.System.loadLibrary(System.java:834) > at > sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) > at java.security.AccessController.doPrivileged(Native Method) > at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) > at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) > at java.awt.Component.<clinit>(Component.java:506) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at com.zzo.javaserver.Dealer.<init>(Dealer.java:369) > at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:165) > at com.zzo.javaserver.TCPServer.run(TCPServer.java:143) > at java.lang.Thread.run(Thread.java:534) > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Javaserver-perl mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javaserver-perl |
From: Kevin W. E. <ken...@ho...> - 2004-02-04 04:27:26
|
just installed on a new box but i'm getting this: java.lang.UnsatisfiedLinkError: /usr/local/j2sdk1.4.2_03/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) at java.security.AccessController.doPrivileged(Native Method) at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) at java.awt.Component.<clinit>(Component.java:506) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at com.zzo.javaserver.Dealer.<init>(Dealer.java:369) at com.zzo.javaserver.SocketHandler.run(SocketHandler.java:165) at com.zzo.javaserver.TCPServer.run(TCPServer.java:143) at java.lang.Thread.run(Thread.java:534) |
From: Kevin W. E. <ken...@ho...> - 2004-01-31 01:28:59
|
hey mark, thanks for the responses. my co-worker already changed his code so it doesn't fork. this is a good work around here though and i'll keep this around if we need it. thing is his code doesn't really need the java stuff. he's got it running as a seperate process now that we call using a signal. thanks again, this is a really good project. i don't know how we'd have gotten our Java stuff to work with perl in such a short period of time without it! kevin ma...@zz... wrote: >Hey Kevin, > You can do something like: > >my $pid = fork; >if ($pid) { > print "parent...\n"; > sleep(5); > print "parent... done\n"; >} else { > undef *Java::DESTROY; > *Java::DESTROY = sub { ; }; > # ... child code here >} > >However any objects you create within the child will not get properly >cleaned up - if you child doesn't create any new objects then this is >fine - alternatively you can put those 2 lines in the parent if the >parent isn't going to make any new objects - beware tho when the child >dies it will shut down the connection so the parent won't have access to >the $java object anymore once the child dies. > > >If you do need to create objects in both the parent and the child then >you something more elaborate like: > >my $pid = fork; >if ($pid) { > print "parent...\n"; > sleep(5); > print "parent... done\n"; >} else { > print "child...\n"; > > my $destroy = *Java::DESTROY; > undef *Java::DESTROY; > *Java::DESTROY = sub { ; }; > > my $child_object = $java->create_object("java.lang.String","zot"); > # use it - now want to destroy it > $destroy->($child_object); > > sleep(1); > print "child...done \n"; >} > >You just need to be careful to explictly call $destroy->($obj) when you're >done with it otherwise you'll have a buncha orhpaned objects lying around - >maybe not a big deal if there aren't too many of 'em - they just take up memory. > Mark > > > > > >------------------------------------------------------- >The SF.Net email is sponsored by EclipseCon 2004 >Premiere Conference on Open Tools Development and Integration >See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >http://www.eclipsecon.org/osdn >_______________________________________________ >Javaserver-perl mailing list >Jav...@li... >https://lists.sourceforge.net/lists/listinfo/javaserver-perl > > |
From: <ma...@zz...> - 2004-01-31 00:56:05
|
Hey Kevin, You can do something like: my $pid = fork; if ($pid) { print "parent...\n"; sleep(5); print "parent... done\n"; } else { undef *Java::DESTROY; *Java::DESTROY = sub { ; }; # ... child code here } However any objects you create within the child will not get properly cleaned up - if you child doesn't create any new objects then this is fine - alternatively you can put those 2 lines in the parent if the parent isn't going to make any new objects - beware tho when the child dies it will shut down the connection so the parent won't have access to the $java object anymore once the child dies. If you do need to create objects in both the parent and the child then you something more elaborate like: my $pid = fork; if ($pid) { print "parent...\n"; sleep(5); print "parent... done\n"; } else { print "child...\n"; my $destroy = *Java::DESTROY; undef *Java::DESTROY; *Java::DESTROY = sub { ; }; my $child_object = $java->create_object("java.lang.String","zot"); # use it - now want to destroy it $destroy->($child_object); sleep(1); print "child...done \n"; } You just need to be careful to explictly call $destroy->($obj) when you're done with it otherwise you'll have a buncha orhpaned objects lying around - maybe not a big deal if there aren't too many of 'em - they just take up memory. Mark |
From: <ma...@zz...> - 2004-01-31 00:00:07
|
That's quite a pickle - & maybe it should be fixed within Java.pm - yah it's trying to be smart & destroying any object that falls out of scope, which it does when the child dies - but that object doesn't belong to the child. Destroy also tried to close the connection with the Java side when the actual '$java' object goes out of scope. Perhaps objects need to be tagged with the pid of the process that created it so they can be destroyed & accessed only by that process. Hm. This will require some more investigation - if you guys are in a hurry I suggest using 'select' instead of 'fork' & run your own event loop as demonstrated in the perldoc until I can come up with something better. thanks, Mark |
From: Kevin W. E. <ken...@ho...> - 2004-01-30 22:20:07
|
Hello all, I just started using JavaServer last week as a quick and dirty way to make my perl stuff talk to Java. This looks like a good project. One problem we've already encountered is in forking within the perl client. After my message is a little test program to demonstrate. everytime it crashes with: child: bye ERROR: java.lang.Exception: Object com.comtelhi.convergepro.DLChannel^1 not in our hash! at dtest.pl line 18 (in cleanup) ERROR: Object com.comtelhi.convergepro.DLChannel^1 does not exist at dtest.pl line 0 (in cleanup) Can't call method "send_command_and_get_response" on an undefined value at /usr/lib/perl5/site_perl/5.6.1/Java.pm line 634 during global destruction. I'm pretty sure this is because the DESTROY method is invoked on the perl side... i'm not sure that there's anything u guys can do about this but my co-worker wanted me to ask before he re-writes his stuff to use signalling instead... thanks..... my $java = new Java(); my $channel = 1 ; print "yo!\n"; ### my $object = $java->com_comtelhi_convergepro_Dispatcher("getChannel", $channel); $object->sayHi(); print "yo!\n"; my $pid = fork(); if ($pid) { print "parent: sleeping.......zzzzzzzzz \n"; sleep (15); print "parent: bye\n"; } else { print "child: sleeping.......zzzzzzzzz \n"; sleep (5); print "child: bye\n"; } |