Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PB10.5 : CreateJavaVM not working with exe

421 views
Skip to first unread message

sandeep

unread,
Aug 22, 2007, 11:57:20 AM8/22/07
to
Hi,
I have created sample application as given at
http://www.sybase.com/detail?id=1037085

Applicaiton works fine with PB development environment. Now
I have compiled the exe of the same and that is not
working... returns -1 for 'CreateJavaVM'. I have copied
jvm.dll ,PBjvm105.DLL, pbejbclient105.pbd,
pbejbclient105.jar to the same directory of application exe.

When I searched on my machine I found many jvm.dll... even
in powerbuilder folder there are two under client and server
folder. I am not sure which to take?

I don't know where else it searchs for this dll and let me
know if i am missing any other .dlls or .jar files to be
copied

Regards,
Sandeep

bede

unread,
Aug 23, 2007, 9:54:30 AM8/23/07
to
haven't seen the testcase, but do check out the registry settings (local machine) for java
that define the relative directory where the classes & JRE are located.

in order to use the ones in the directory of the installed application, we set it as follows:

[HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\10.5\Java]
"JDKLocation"="."
"JDKLocationDef"="."
"JREBinLocation"=".\\jre\\bin\\client"
"JREBinLocationDef"=".\\jre\\bin\\client"

obviously -in this example- we have a jre folder where the exe is deployed

HTH,

Ben

PS: activate JVM logging to find out from where the classes are loaded/used


In article <46cc5ce0.32d...@sybase.com>, sandeep says...

brettbirschbach

unread,
Aug 24, 2007, 4:01:50 PM8/24/07
to
I'm having similar problems with starting my Java VM for a
deployed app. I can get it to work on some computers and
not on others, so I'm trying to figure out the correct
combination of settings.

Modifying the registry keys, at least for PB 11, for JDK and
JRE locations does absolutely nothing except for change my
Java version in the IDE. This has no bearing on the
deployed app.

Am I missing something?

Furthermore, though it is not documented, my testing shows
that setting the $JAVA_HOME environment variable to a JDK
will cause the deployed app to use that java version instead
of the default in the PB shared directory.

This is so frustrating...the documentation on running java
from a deployed app is extremely lacking...

bede

unread,
Aug 27, 2007, 5:39:41 AM8/27/07
to
Can't say much on PB 11 yet, but for prior versions (eg 10.5) Java configuration properties
are stored in separate folders for IDE and RunTime (deployed exe)

HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\10.5\Java\PBIDECONFIG
HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\10.5\Java\PBRTCONFIG

Depending on the app. server, you'll have to define specific startup options.
- define what JVM logging you want
- extra JVM startup props (e.g. required to connect to a WebSphere server)
...

in my experience, common problems are:
- JVM doesn't load -> check environment variables (java, path, javahome) & LOCALMACHINE
settings on the deployed PCs.

- lookup/connect fails (check for correct JVM loaded) -> check classpath, app.server
dependent classes present, compressed jars (best to zip with 0% compression), app.server
deployment

- serialization errors (eg: "cannot read from underlying bridge") --> client classes doesn't
match server classes

- PBNI -> incompatible PB proxies for java classes

Ben

PS: It's true that PB-java doc/samples is not sufficient, IMO it deserves much more
attention.


In article <46cf392e.73b...@sybase.com>, Brett Birschbach says...

0 new messages