1. Kevin Geist
  2. PowerBuilder
  3. Wednesday, 7 October 2020 16:08 PM UTC

I am trying to get a PB19 version of an application running using JDBC to connect to the a SqlAnywhere 12 db.  The application is run from a share drive location.  I am getting this error :  Could not initialize JavaVM

I have a PB12 version of this same app  connecting to the same db using JDBC and it runs fine from the share drive.

When I converted this app to PB19, I had no problem getting it run in powerbuilder after adding the jar in PB like this

 

To kick off the program, I use a small batch file with these commands:

   set classpath=".;M:\APPS\Invoice19\SQL12\java\sajdbc4.jar"
   start invoice.exe

 

From my PC that has PB19 installed I can run the program from the sharedrive and it works fine.  It connects, however, if I try to run from a machine that doesn't have PB19 installed I get this error : Could not initialize JavaVM

I compared the PB DLLs used to run the app between PB12 and PB19 and I see I do have the PBjvm190.DLL deployed.  So, I don't understand why its not working, I think there must be other DLLS that need to be deployed.  PLEASE Help ! 

 

 

Accepted Answer
Kevin Geist Accepted Answer Pending Moderation
  1. Wednesday, 7 October 2020 19:00 PM UTC
  2. PowerBuilder
  3. # Permalink

I did the 3 things you suggested, but, it still did not work. 

I then decided to make a 32 bit version of the app and deploy the 32 bit version to a new folder on the sharedrive, with the 32 bit deployment msi contents.  That seems to have fixed things.  

I guess on my development PC I can run the 64 bit version of the app and when it comes time to access the db, it knows to use some 32 bit dlls?  

Comment
  1. Kevin Geist
  2. Thursday, 8 October 2020 12:07 PM UTC
I verified Java 8 version 201 is installed in Programs and Apps for the machine that is failing to connect with 64 bit version of the app, is that what you mean?

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 8 October 2020 15:17 PM UTC
Hi Kevin ... correct.

BTW: I am using JDK/JRE v 1.8.0_221
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 5 August 2021 04:51 AM UTC
Be careful with distributing latest versions of Oracle Java runtime. You might force your customers to start paying to Oracle or get hefty fines when being audited.

I'd rather use an older jre or use the open source versions.
  1. Helpful 1
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Wednesday, 4 August 2021 13:34 PM UTC
  2. PowerBuilder
  3. # 1

The main issue that resolved this issue was to use all 32bit versions 

Comment
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Thursday, 15 October 2020 17:34 PM UTC
  2. PowerBuilder
  3. # 2

I have this working now, here were the fixes needed, JavaVM 64bit and ALL the required dlls to connect)

Installing Java 8 update 261 64bit  that solved the : could not initial JavaVM   (Java 8 update 201 32bit did not work and that is what all my users have on their PCs by default.)

 http://dcx.sap.com/index.html#1201/en/dbprogramming/pg-jdbc-4-0-load.html

The above link only indicates the use of dbjdbc12.dll but not its supporting dlls. This was the problem after getting an acceptable JVM.  I had not deployed the other supporting dlls that are listed below on another link which I found this AM. 

http://dcx.sap.com/index.html#1201/en/dbprogramming/jdbc-driver-deploy.html

Platform

Required files

Windows

dbjdbc12.dll

dbicu12.dll

dbicudt12.dll

dblg[LL]12.dll

 

 

Thanks everyone for your pointers along the way

Comment
  1. Miguel Leeuwe
  2. Thursday, 15 October 2020 23:31 PM UTC
Thanks for sharing Kevin, great you've got it solved!
  1. Helpful
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Wednesday, 14 October 2020 19:08 PM UTC
  2. PowerBuilder
  3. # 3

 

   Java Exception : Fatal Error. Unable to initialize DatabaseMetaData  

What am I missing or is this a bug with PB19 and using JDBC to connect to sqlanywhere 12 dbs?

 

Progress summary: So our user test PC has JVM running and found now, and the jar file is found....

I Installed Java 8 261 on a sample user computer, that got us past the error : "Could not initial Java VM" on machines that don't have PB on them.  They did have Java Update 201, but, that is a 32 bit version.  I don't know if that is part of why the app did not recognize it. 

The batch file method we used to set the classpath of the jar works as well. 

The  set classpath=".;M:\APPS\Invoice19\SQL12\java\sajdbc4.jar"  in my bat file  gets me past the error "Could not load class sybase.jdbc4.sqlanywhere.IDriver"

 

 

 

 

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 8 October 2020 20:12 PM UTC
  2. PowerBuilder
  3. # 4

here`s the image attached, if that maybe is easier to look at (see attached)

(Related to my previous answer where I pasted the image)

Attachments (1)
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 8 October 2020 20:11 PM UTC
  2. PowerBuilder
  3. # 5

Your end user, who doesn`t have pb installed, still needs the same registry entries that you would find on your developer`s machine, after having specified the jdbc drivers in system options > java tab page. It works for them with pb 12, because probably those registry entries are available in their registry.

However pb 2019 has a different folder where it looks for the drivers.

Here`s an example of what`s needed for our Tibero database, to which we connect with JDBC:

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 8 October 2020 19:54 PM UTC
  2. PowerBuilder
  3. # 6

FWIW: I do not use a ClassPath. Instead, I let my PB Apps rely on the System Path for the correct JVM ....

Comment
  1. Miguel Leeuwe
  2. Wednesday, 14 October 2020 20:26 PM UTC
Hi,

Shouldn't that be JAVA_HOME instead of JAVA ?

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 14 October 2020 20:28 PM UTC
When I do "set java", I'm getting:



Microsoft Windows [Version 10.0.20185.1000]

(c) 2020 Microsoft Corporation. All rights reserved.



C:\Users\mjlre>set java

JAVA_HOME=C:\java\jdk-11.0.1



Funny difference.

  1. Helpful
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Thursday, 8 October 2020 19:11 PM UTC
  2. PowerBuilder
  3. # 7

The problem still remains and I'm not seeing what I am missing from the instructions for PB19 and what I've done in the past with Prior release of PB.  Here is a summary of the things I have done.

  1. PBjvm190.DLL  is in the share drive directory with everything else under "C:\Program Files (x86)\Appeon\Shared\PowerBuilder\x64"  on my development PC, see list below:
  2.  Java 8 update 201 is installed under Programs and Apps for the machines that are failing to connect  
  3. To kick off the program, I use a small batch file with these commands:

       set classpath=".;M:\APPS\Invoice19\SQL12\java\sajdbc4.jar"
       start invoice.exe

    • This sajdbc4.jar is the same one used on my development machine and is the same one used with the PB12 Share drive deployed app that works with JDBC 
    • The exe and its needed PBDs are also in this folder.

 

All files of ShareDrive folder in the app exe:

"M:\APPS\Invoice19\uat64\pbhttpclient190.dll"
"M:\APPS\Invoice19\uat64\pbjson190.dll"
"M:\APPS\Invoice19\uat64\Sybase.PowerBuilder.DataSource.OData.dll"
"M:\APPS\Invoice19\uat64\Sybase.PowerBuilder.ODataClient.dll"
"M:\APPS\Invoice19\uat64\Sybase.PowerBuilder.ODataWrapper.dll"
"M:\APPS\Invoice19\uat64\pbejbclient190.pbx"
"M:\APPS\Invoice19\uat64\PBDOM190.pbx"
"M:\APPS\Invoice19\uat64\pbwsclient190.pbx"
"M:\APPS\Invoice19\uat64\pbjdbc12190.jar"
"M:\APPS\Invoice19\uat64\pbodb190.ini"
"M:\APPS\Invoice19\uat64\atl100.dll"
"M:\APPS\Invoice19\uat64\msvcp100.dll"
"M:\APPS\Invoice19\uat64\msvcr100.dll"
"M:\APPS\Invoice19\uat64\msvcr120.dll"
"M:\APPS\Invoice19\uat64\APACHE_LICENSE.TXT"
"M:\APPS\Invoice19\uat64\Gnu--LGPL.txt"
"M:\APPS\Invoice19\uat64\LICENSE"
"M:\APPS\Invoice19\uat64\pblab190.ini"
"M:\APPS\Invoice19\uat64\Thai Open License.txt"
"M:\APPS\Invoice19\uat64\jdk1.6.0_24"
"M:\APPS\Invoice19\uat64\TBInvoiceLaunchJDBCUAT.bat"
"M:\APPS\Invoice19\uat64\maint.pbd"
"M:\APPS\Invoice19\uat64\audits.pbd"
"M:\APPS\Invoice19\uat64\invoice.pbd"
"M:\APPS\Invoice19\uat64\shared.pbd"
"M:\APPS\Invoice19\uat64\invoice.exe"
"M:\APPS\Invoice19\uat64\pbwebbrowser190.dll"
"M:\APPS\Invoice19\uat64\libglog.dll"
"M:\APPS\Invoice19\uat64\ssleay32.dll"
"M:\APPS\Invoice19\uat64\EasySoap190.dll"
"M:\APPS\Invoice19\uat64\ExPat190.dll"
"M:\APPS\Invoice19\uat64\libeay32.dll"
"M:\APPS\Invoice19\uat64\libjcc.dll"
"M:\APPS\Invoice19\uat64\xerces-c_2_8.dll"
"M:\APPS\Invoice19\uat64\xerces-depdom_2_8.dll"
"M:\APPS\Invoice19\uat64\pbdotnetcoreinvoker190.dll"
"M:\APPS\Invoice19\uat64\pbdotnetframeworkinvoker190.dll"
"M:\APPS\Invoice19\uat64\pbstatusbar190.dll"
"M:\APPS\Invoice19\uat64\pbtheme190.dll"
"M:\APPS\Invoice19\uat64\pbresource190.dll"
"M:\APPS\Invoice19\uat64\pbdotnet190.dll"
"M:\APPS\Invoice19\uat64\pbribbonbar190.dll"
"M:\APPS\Invoice19\uat64\libcrypto-1_1-x64.dll"
"M:\APPS\Invoice19\uat64\pbcompression190.dll"
"M:\APPS\Invoice19\uat64\pbjwt190.dll"
"M:\APPS\Invoice19\uat64\pbNetWSRuntime190.dll"
"M:\APPS\Invoice19\uat64\pbsysfunc190.dll"
"M:\APPS\Invoice19\uat64\pbcrypt190.dll"
"M:\APPS\Invoice19\uat64\pboauth190.dll"
"M:\APPS\Invoice19\uat64\pbXerces190.dll"
"M:\APPS\Invoice19\uat64\Sybase.PowerBuilder.DataSource.Db.dll"
"M:\APPS\Invoice19\uat64\Sybase.PowerBuilder.DataWindow.Excel12.dll"
"M:\APPS\Invoice19\uat64\pbvm190.dll"
"M:\APPS\Invoice19\uat64\pbUIS190.dll"
"M:\APPS\Invoice19\uat64\pbtra190.dll"
"M:\APPS\Invoice19\uat64\pbtrs190.dll"
"M:\APPS\Invoice19\uat64\pbsnc190.dll"
"M:\APPS\Invoice19\uat64\pbsyc190.dll"
"M:\APPS\Invoice19\uat64\pbrth190.dll"
"M:\APPS\Invoice19\uat64\pbshr190.dll"
"M:\APPS\Invoice19\uat64\pbPDF190.dll"
"M:\APPS\Invoice19\uat64\pbrtc190.dll"
"M:\APPS\Invoice19\uat64\pbora190.dll"
"M:\APPS\Invoice19\uat64\pbo90190.dll"
"M:\APPS\Invoice19\uat64\pbodb190.dll"
"M:\APPS\Invoice19\uat64\pbodt190.dll"
"M:\APPS\Invoice19\uat64\pbodw190.dll"
"M:\APPS\Invoice19\uat64\pbjdb190.dll"
"M:\APPS\Invoice19\uat64\pbjvm190.dll"
"M:\APPS\Invoice19\uat64\pbo10190.dll"
"M:\APPS\Invoice19\uat64\pbDWExcel12Interop190.dll"
"M:\APPS\Invoice19\uat64\pbi10190.dll"
"M:\APPS\Invoice19\uat64\pbin9190.dll"
"M:\APPS\Invoice19\uat64\pbdwe190.dll"
"M:\APPS\Invoice19\uat64\pbase190.dll"
"M:\APPS\Invoice19\uat64\pbCSI190.dll"
"M:\APPS\Invoice19\uat64\pbdpl190.dll"
"M:\APPS\Invoice19\uat64\pbacc190.dll"
"M:\APPS\Invoice19\uat64\pbado190.dll"
"M:\APPS\Invoice19\uat64\pbrestclient190.dll"

Comment
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Wednesday, 7 October 2020 19:31 PM UTC
  2. PowerBuilder
  3. # 8

I've copied over all the files in the folder C:\Program Files (x86)\Appeon\Shared\PowerBuilder\x64 

I already had most of these files in there from the 64 bit deployment msi.  No difference.  Same error. 

It works from my development machine if I run it from the sharedrive location using my bat file.  So, not just from within the PB IDE.

I did not copy over the 3 subfolders.  

 

Comment
There are no comments made yet.
Kevin Geist Accepted Answer Pending Moderation
  1. Wednesday, 7 October 2020 16:30 PM UTC
  2. PowerBuilder
  3. # 9

Thanks for the quick response, Yes, I did include pbjvm190.dll, noted above :

 ...I compared the PB DLLs used to run the app between PB12 and PB19 and I see I do have the PBjvm190.DLL deployed.  So, I don't understand why its not working, I think there must be other DLLS that need to be deployed.  PLEASE Help ! 

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 7 October 2020 16:38 PM UTC
I would double-check the JAR file's date and location with regards to your ClassPath statement.

For a full list of required DLL's, check the PB Help using the keyword search "runtime".

Make sure though that all the "base" DLL's are there including the "LIBxxxx.dll" ones. These are used by the Inter-Op.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 7 October 2020 16:22 PM UTC
  2. PowerBuilder
  3. # 10

Hi Kevin;

  Did you deploy the "pbjvm190" DLL that supports the PB=>Java VM Inter-Op?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.