Java Bridge Setup?

General discussion forum for the Zend Server

Java Bridge Setup?

Postby instynct on Fri Dec 21, 2012 8:16 am

I'm having trouble finding documentation on setting up the Java bridge, on my zen control panel it says 'ERR' for java bridge and in the logs when I try to run a java method. (windows)

Code: Select all
[21-Dec-2012 06:29:54 UTC] PHP Fatal error:  Uncaught exception 'JavaException' with message 'Can not connect to Java Server: No such file or directory' in C:\Program Files (x86)\Zend\Apache2\htdocs\videos\get\index.php:5
Stack trace:
#0 C:\Program Files (x86)\Zend\Apache2\htdocs\videos\get\index.php(5): *No Class!*->jbridge('java.text.Simpl...', 'EEEE, MMMM dd, ...')
#1 {main}
instynct
 
Posts: 4
Joined: Fri Dec 21, 2012 8:14 am

Re: Java Bridge Setup?

Postby zvika on Tue Dec 25, 2012 10:03 am

Hi

It seems you are missing class in the JAVA runtime.

OPTION 1
If you have additional Class JARs to add to CLASSPATH, backup and edit the following ini file,
"C:\Program Files (x86)\Zend\ZendServer\etc\java_bridge_server.ini"
then add full paths to any jar required for your Java application, into the CLASSPATH, separated by semicolons:

So the line looks like this:
CLASSPATH="C:\Program Files (x86)\Zend\ZendServer\bin\javamw.jar;.;D:\PATH\TO\CLASSA.JAR;D:\PATH\TO\CLASSB.JAR"

After saving the file, restart "Zend Java Bridge" service to load the new Class Path:
Run services.msc and locate "Zend Java Bridge", right click and restart service,
or from admin command line execute:
Code: Select all
net stop ZendJavaBridge
net start ZendJavaBridge

After that, check the code again.

OPTION 2
If you are calling a native JAVA Runtime which does not exist on the JRE you load with Java Bridge service,
check the output of the following command to know which JRE is used with Zend Java Bridge service:
Code: Select all
sc qc ZendJavaBridge 886

The service "Path to Execute" is the entity we need to examine - you can also double click the "Zend Java Bridge" in the Windows Services and check the line.

To configure an alternate JRE, for example if you have JAVA7 and you need to downgrade to JAVA6 for your application,
you can use the sc "config" command - reference: http://technet.microsoft.com/en-us/library/bb490995.aspx

For example, to replace JRE7 with JRE6 on a Windows with both JAVA versions, you can run this:
[UPDATE] Fixed typo in the command below - no space between JavaServer.exe and jvm.dll.
Code: Select all
>sc config ZendJavaBridge binpath= "\"C:\Program Files (x86)\Zend\ZendServer\bin\JavaServer.exe\" \"C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll\" -Dzend.javamw.log=0 -Dzend.javamw.logfile=\"C:\Program Files (x86)\Zend\ZendServer\logs\javamw.log\" -Dzend.javamw.threads=20 -Dzend.javamw.port=10001 \"C:\Program Files (x86)\Zend\ZendServer\etc\java_bridge_server.ini\""

After modification, restart "Zend Java Bridge" service as I mentioned above.
---

Please report back with any results.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 818
Joined: Sun Dec 14, 2008 9:48 am

Re: Java Bridge Setup?

Postby instynct on Wed Dec 26, 2012 3:08 am

Thanks for the reply. So in services my Zend Java Bridge service is not started, if I try to start it says 'The service has started then stopped'.
instynct
 
Posts: 4
Joined: Fri Dec 21, 2012 8:14 am

Re: Java Bridge Setup?

Postby zvika on Wed Dec 26, 2012 12:04 pm

Please check the Windows Event Viewer for new events that happen when you start the ZendJavaBridge service manually.
Also, I still need to check output of the command to know how the service is defined:
Code: Select all
sc qc ZendJavaBridge 886

Last thing - please check if you have this log generated, and post the last error from starting the service.
Code: Select all
C:\Windows\Temp\JavaBridgeServer.log
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 818
Joined: Sun Dec 14, 2008 9:48 am

Re: Java Bridge Setup?

Postby instynct on Thu Dec 27, 2012 7:03 am

zvika wrote:Please check the Windows Event Viewer for new events that happen when you start the ZendJavaBridge service manually.
Also, I still need to check output of the command to know how the service is defined:
Code: Select all
sc qc ZendJavaBridge 886

Last thing - please check if you have this log generated, and post the last error from starting the service.
Code: Select all
C:\Windows\Temp\JavaBridgeServer.log

Here's the command output:

C:\Users\Jesse>sc qc ZendJavaBridge 886
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: ZendJavaBridge
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 0 IGNORE
BINARY_PATH_NAME : "C:\Program Files (x86)\Zend\ZendServer\bin\JavaSer
ver.exe" "C:\Program Files\Java\jre7\bin\server\jvm.dll" -Dzend.javamw.log=0 -Dz
end.javamw.logfile="C:\Program Files (x86)\Zend\ZendServer\logs\javamw.log" -Dze
nd.javamw.threads=20 -Dzend.javamw.port=10001 "C:\Program Files (x86)\Zend\ZendS
erver\etc\java_bridge_server.ini"
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Zend Java Bridge
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem

C:\Users\Jesse>


And here's the JavaBridgeServer.log

[Java Bridge Server 20.12.2012 21:29:35 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 20.12.2012 21:29:35 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 20.12.2012 22:41:26 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 20.12.2012 22:41:26 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 22.12.2012 18:46:22 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 22.12.2012 18:46:22 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 22.12.2012 18:50:19 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 22.12.2012 18:50:19 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 25.12.2012 18:03:52 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 25.12.2012 18:03:52 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 25.12.2012 18:06:52 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 25.12.2012 18:06:52 ERROR] Java Server is exiting because of an error.
[Java Bridge Server 25.12.2012 18:09:01 ERROR] Unable to load JVM at C:\Program Files\Java\jre7\bin\server\jvm.dll . QLibrary::load_sys: Cannot load C:\Program Files\Java\jre7\bin\server\jvm.dll ()
[Java Bridge Server 25.12.2012 18:09:01 ERROR] Java Server is exiting because of an error.
instynct
 
Posts: 4
Joined: Fri Dec 21, 2012 8:14 am

Re: Java Bridge Setup?

Postby zvika on Thu Dec 27, 2012 8:52 am

Hi

Thanks for the info.
I believe the problem is loading 64-bit (Program Files) JVM instead of 32-bit (Program Files x86).

Please try to reconfigure ZendJavaBridge service exactly as I suggested earlier (verify that the path for jvm.dll exists on your Windows), then try to start the Java Bridge service again.
Code: Select all
sc config ZendJavaBridge binpath= "\"C:\Program Files (x86)\Zend\ZendServer\bin\JavaServer.exe\" \"C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll\" -Dzend.javamw.log=0 -Dzend.javamw.logfile=\"C:\Program Files (x86)\Zend\ZendServer\logs\javamw.log\" -Dzend.javamw.threads=20 -Dzend.javamw.port=10001 \"C:\Program Files (x86)\Zend\ZendServer\etc\java_bridge_server.ini\""

Code: Select all
net start ZendJavaBridge

Please report back with any results.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 818
Joined: Sun Dec 14, 2008 9:48 am


Return to Zend Server

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests

cron