spring mvc - dll already loaded in another classloader in netbeans using tomcat -


currently develop java web application using spring mvc, netbeans ide, , tomcat web server.

i want use 3rd party jar , seems no problem occurs when use jar in simple java application. when use in webapp, triggers error, error message:

caused by: java.lang.unsatisfiedlinkerror: native library c:\program files (x86)\safenet\protect toolkit c sdk\bin\jcprov.dll loaded in classloader 

this code call classes in jar:

    cryptokiex.c_initialize(new ck_c_initialize_args(ckf.os_locking_ok)); //below code cause error     cryptokiex.c_opensession(0, ckf.rw_session, null, null, session); 

the second line of code cause error.

the first time code executed, did not trigger error, buat after that, trigger error. tried stop tomcat netbeans, close netbeans , re-open again, , still triggers error.

i googled answer , points me link:

http://wiki.apache.org/tomcat/howto#i.27m_encountering_classloader_problems_when_using_jni_under_tomcat

but says class load native library should placed in $catalina_home/shared/lib. placed jar directory error still occurs.

i run in command line: mvn tomcat:run on project directory , error did not occurs time, not know why. still, want run netbeans, not command line.

i assume have placed jar in shared $catalina_home/shared/lib, webapp still depends on jar placed in lib folder of webapp project, not jar placed in $catalina_home/shared/lib. use in-project repository include jar, how include jar placed in $catalina_home/shared/lib?

i appreciate guys, thanks!

there a static-dll-bootstrapper project in proper way.

your trouble should solved in few simple steps.

  • place jar shared.loader path
  • define lib name in dll-bootstrapper.properties near jar
  • place class.forname("msm.dllbootstrapper"); in project code
  • enjoy

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -