The problem of Thread in C++
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andy_Hu
Posted On:   Tuesday, September 12, 2006 10:14 PM

Now my plan is to use the C++ to invoke Java Library and realize the JMX function. when i use the single Thread , all the C++ code is ok, but Now i add multithread , that is Create an JVM in the main(), and AttachCurrentThread((void**)&env, NULL); But the problem is coming, the c++ code :objAdminClient = CallStaticObjectMethod(clsAdminClientFactory, midCreateAdminClient, objConnectProps); this code is mapped to the java code:adminClient = AdminClientFactory.createAdminClient(connectProps); and it will connect the J2EE server, such as WAS, the Exception is throwing:java.lang.ExceptionInInitializerError at org.eclipse.hyades.logging.events.cbe.util.EventHelpers. (Even tHelpers.java:54) at org.eclipse.hyades.logging.events.cbe.impl.Com   More>>

Now my plan is to use the C++ to invoke Java Library and realize the JMX function. when i use the single Thread , all the C++ code is ok, but Now i add multithread , that is Create an JVM in the main(), and AttachCurrentThread((void**)&env, NULL); But the problem is coming, the c++ code :objAdminClient = CallStaticObjectMethod(clsAdminClientFactory, midCreateAdminClient, objConnectProps); this code is mapped to the java code:adminClient = AdminClientFactory.createAdminClient(connectProps); and it will connect the J2EE server, such as WAS, the Exception is throwing:java.lang.ExceptionInInitializerError
at org.eclipse.hyades.logging.events.cbe.util.EventHelpers. (Even
tHelpers.java:54)
at org.eclipse.hyades.logging.events.cbe.impl.CommonBaseEventImpl.setCre
ationTimeAsLong(CommonBaseEventImpl.java:568)
at org.eclipse.hyades.logging.java.CommonBaseEventLogRecord.setMillis(Co
mmonBaseEventLogRecord.java)
at org.eclipse.hyades.logging.java.CommonBaseEventLogRecord. (Commo
nBaseEventLogRecord.java)
at com.ibm.ws.logging.object.WsLogRecordFactory.createWsLogRecord(WsLogR
ecordFactory.java:126)
at com.ibm.ejs.ras.Tr.logToJSR47Logger(Tr.java:1560)
at com.ibm.ejs.ras.Tr.fireEvent(Tr.java:1490)
at com.ibm.ejs.ras.Tr.fireMessageEvent(Tr.java:1422)
at com.ibm.ejs.ras.Tr.warning(Tr.java:1123)
at com.ibm.websphere.management.AdminClientFactory.loadPropertiesFromFil
e(AdminClientFactory.java:442)
at com.ibm.websphere.management.AdminClientFactory.access$000(AdminClien
tFactory.java:81)
at com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFact
ory.java:226)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll
er.java:63)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm
inClientFactory.java:224)
Caused by: java.lang.NullPointerException
at org.eclipse.emf.ecore.impl.EPackageRegistryImpl$Delegator.get(EPackag
eRegistryImpl.java:183)
at org.eclipse.hyades.logging.events.cbe.impl.EventPackageImpl.init(Even
tPackageImpl.java:268)
at org.eclipse.hyades.logging.events.cbe.EventPackage. (EventPack
age.java:68).....


i try the multithread in java ,that is ok. That confuses me......

   <<Less
About | Sitemap | Contact