[jboss-jira] [JBoss JIRA] Created: (JBCOMMON-87) JBossEntityResolver.loadClasspathResource causes NPE when running via JNI
steve bucknam (JIRA)
jira-events at lists.jboss.org
Fri Jul 31 11:23:29 EDT 2009
JBossEntityResolver.loadClasspathResource causes NPE when running via JNI
-------------------------------------------------------------------------
Key: JBCOMMON-87
URL: https://jira.jboss.org/jira/browse/JBCOMMON-87
Project: JBoss Common
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: common-core (2.x)
Affects Versions: 2.2.13.GA
Environment: windows xp 32-bit, MS Visual C++ 2008, eclipse 3.4.2 with Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Reporter: steve bucknam
I created a C++ program the invokes a Java method via JNI. The classpath is setup to include all required JBoss Cache 3.1.0 jars including JBoss Common. This method instantiates JBoss Cache as follows:
CacheFactory<String, String> aFactory = new DefaultCacheFactory<String, String>();
Cache cache = aFactory.createCache(configFile);
This causes a NullPointerException in JBossEntityResolver.loadClasspathResource(). The code is as follows:
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource(resource);
The ContextClassLoader will always be null when run within JNI.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list