File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes An exception has occurred Can't initialize jni4net Bridge Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "An exception has occurred Can Watch "An exception has occurred Can New topic
Author

An exception has occurred Can't initialize jni4net Bridge

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
I am working with templates, docm files, and integrating them with java

I am getting an error as follows:

An exception has occurred Can't initialize jni4net Bridge

it appears that OfficeWriterBridge.j4n.jar is related to this but I don't know how. Also jni4net.-0.8.6.0.jar.

Thanks,
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

Do you get a full stack trace? If so, can you please post it here?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
[...]
2012-04-03 16:36:26,682 ERROR [STDERR] Can't initialize jni4net BridgeC:\apps\OfficeWriter\jni4net.n.w64.v40-0.8.6.0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
2012-04-03 16:36:26,683 ERROR [STDERR] net.sf.jni4net.inj.INJException: Can't initialize jni4net Bridge
2012-04-03 16:36:26,683 ERROR [STDERR] at net.sf.jni4net.CLRLoader.init(CLRLoader.java:56)
2012-04-03 16:36:26,683 ERROR [STDERR] at net.sf.jni4net.Bridge.init(Bridge.java:46)
2012-04-03 16:36:26,683 ERROR [STDERR] at bcc.pages.documentManagement.DMTemplateLoader.doAction(DMTemplateLoader.java:6227)
2012-04-03 16:36:26,683 ERROR [STDERR] at bcc.lib.BaseDoServlet.doServletFunction(BaseDoServlet.java:30)
2012-04-03 16:36:26,684 ERROR [STDERR] at bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:102)
2012-04-03 16:36:26,684 ERROR [STDERR] at bcc.lib.BaseBccServlet.doGet(BaseBccServlet.java:54)
2012-04-03 16:36:26,684 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
2012-04-03 16:36:26,684 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
2012-04-03 16:36:26,684 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
2012-04-03 16:36:26,685 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
2012-04-03 16:36:26,685 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
2012-04-03 16:36:26,685 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
2012-04-03 16:36:26,685 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
2012-04-03 16:36:26,688 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
2012-04-03 16:36:26,689 ERROR [STDERR] Caused by: java.lang.UnsatisfiedLinkError: C:\apps\OfficeWriter\jni4net.n.w64.v40-0.8.6.0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
2012-04-03 16:36:26,689 ERROR [STDERR] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
2012-04-03 16:36:26,689 ERROR [STDERR] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
2012-04-03 16:36:26,689 ERROR [STDERR] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
2012-04-03 16:36:26,689 ERROR [STDERR] at java.lang.Runtime.load0(Runtime.java:769)
2012-04-03 16:36:26,689 ERROR [STDERR] at java.lang.System.load(System.java:968)
2012-04-03 16:36:26,689 ERROR [STDERR] at net.sf.jni4net.CLRLoader.init(CLRLoader.java:47)
2012-04-03 16:36:26,689 ERROR [STDERR] ... 25 more
[...]
2012-04-03 16:38:21,949 ERROR [STDERR] Can't initialize jni4net BridgeC:\apps\OfficeWriter\jni4net.n.w64.v40-0.8.6.0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
2012-04-03 16:38:21,949 ERROR [STDERR] net.sf.jni4net.inj.INJException: Can't initialize jni4net Bridge
2012-04-03 16:38:21,950 ERROR [STDERR] at net.sf.jni4net.CLRLoader.init(CLRLoader.java:56)
2012-04-03 16:38:21,950 ERROR [STDERR] at net.sf.jni4net.Bridge.init(Bridge.java:46)
2012-04-03 16:38:21,950 ERROR [STDERR] at bcc.pages.documentManagement.DMTemplateLoader.doAction(DMTemplateLoader.java:6227)
2012-04-03 16:38:21,950 ERROR [STDERR] at bcc.lib.BaseDoServlet.doServletFunction(BaseDoServlet.java:30)
2012-04-03 16:38:21,950 ERROR [STDERR] at bcc.lib.BaseBccServlet.doPost(BaseBccServlet.java:102)
2012-04-03 16:38:21,950 ERROR [STDERR] at bcc.lib.BaseBccServlet.doGet(BaseBccServlet.java:54)
2012-04-03 16:38:21,950 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
2012-04-03 16:38:21,950 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
2012-04-03 16:38:21,950 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
2012-04-03 16:38:21,950 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2012-04-03 16:38:21,950 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2012-04-03 16:38:21,950 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2012-04-03 16:38:21,950 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
2012-04-03 16:38:21,951 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
2012-04-03 16:38:21,954 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
2012-04-03 16:38:21,954 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
2012-04-03 16:38:21,954 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
2012-04-03 16:38:21,954 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
2012-04-03 16:38:21,955 ERROR [STDERR] Caused by: java.lang.UnsatisfiedLinkError: C:\apps\OfficeWriter\jni4net.n.w64.v40-0.8.6.0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
2012-04-03 16:38:21,955 ERROR [STDERR] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
2012-04-03 16:38:21,955 ERROR [STDERR] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
2012-04-03 16:38:21,955 ERROR [STDERR] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
2012-04-03 16:38:21,955 ERROR [STDERR] at java.lang.Runtime.load0(Runtime.java:769)
2012-04-03 16:38:21,955 ERROR [STDERR] at java.lang.System.load(System.java:968)
2012-04-03 16:38:21,955 ERROR [STDERR] at net.sf.jni4net.CLRLoader.init(CLRLoader.java:47)
2012-04-03 16:38:21,955 ERROR [STDERR] ... 25 more
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

I've removed all the irrelevant logging information. What remains is one error thrown twice. Its message is clear - you have a DLL file compiled for a 64-bit system but are using a 32-bit JVM. Either replace this DLL with one for a 32-bit system, or switch to a 64-bit JVM (this also requires a 64-bit operating system).
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
Makes sense, thanks a lot,
I mean a LOT!!!
Michele
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

You're welcome
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 412
Hello again, I tried to get rid (delete) the 64 bit one but it caused instability. What should I do, unregister the 64 bit one? I am unsure what to do. BTW, it works okay on the production server, but not on the testing server. Thanks,
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

You'll need to TellTheDetails to us. What "instability" exactly means? Which errors are you getting?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: An exception has occurred Can't initialize jni4net Bridge