Hello,

I have identified a problem with the pax-web-jsp project and I would like to 
contribute a fix. What is the best approach ? Opening a JIRA ticket, asking for 
commitership ? 

Here are some details about the issue. I have been testing the pax-web-jsp 
under the IBM Websphere 7 platform, and this server comes with it's own JVM 
that has a different behavior than Oracle's one. Basically I had a problem with 
the JasperClassLoader class that was raising an exception inside the 
constructor. Here is the stack trace:

java.lang.NullPointerException
        at 
org.ops4j.pax.web.jsp.internal.JasperClassLoader.hashCode(JasperClassLoader.java:197)
        at 
com.ibm.oti.shared.SharedAbstractHelperFactory.objectToString(SharedAbstractHelperFactory.java:92)
        at 
com.ibm.oti.shared.SharedAbstractHelperFactory.findSharedHelperForClassLoader(SharedAbstractHelperFactory.java:126)
        at 
com.ibm.oti.shared.SharedClassHelperFactoryImpl.findHelperForClassLoader(SharedClassHelperFactoryImpl.java:51)
        at 
com.ibm.oti.shared.SharedClassHelperFactoryImpl.getURLClasspathHelper(SharedClassHelperFactoryImpl.java:145)
        at 
java.net.URLClassLoader.initializeSharedClassesSupport(URLClassLoader.java:180)
        at java.net.URLClassLoader.<init>(URLClassLoader.java:249)
        at 
org.ops4j.pax.web.jsp.internal.JasperClassLoader.<init>(JasperClassLoader.java:70)
        at 
org.ops4j.pax.web.jsp.JspServletWrapper.<init>(JspServletWrapper.java:62)
        at 
org.jahia.bundles.extender.jahiamodules.JspBundleObserver.addingEntries(JspBundleObserver.java:30)
        at 
org.ops4j.pax.swissbox.extender.BundleWatcher$3.run(BundleWatcher.java:226)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
        at java.util.concurrent.FutureTask.run(FutureTask.java:149)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:109)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:217)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
        at java.lang.Thread.run(Thread.java:738)

Looking at the details it seems that IBM's JVM is calling the hashCode method 
before the object has finished it's constructor, and therefore the 
m_bundleClassLoader field is still null. I fixed this issue with the following 
patch :

===================================================================
--- 
pax-web-jsp/src/main/java/org/ops4j/pax/web/jsp/internal/JasperClassLoader.java 
    (revision 2b46fb08893ed5cc905ae1e5d920a5afdf82d29b)
+++ 
pax-web-jsp/src/main/java/org/ops4j/pax/web/jsp/internal/JasperClassLoader.java 
    (revision )
@@ -189,6 +189,11 @@
          */
        
        LOG.trace("Using m_bundleClassloader.hashCode()");
+
+        if (m_bundleClassLoader == null) {
+            return super.hashCode();
+        }
+
        final Bundle bundle = m_bundleClassLoader.getBundle();
        
        // This operation guarantees that the JasperClassLoader will fall in 
the same bucket as the BundleClassLoader it is wrapping

Let me know what is the best way to contribute this, I'd be more than happy to 
contribute this :)

Best regards,
  Serge Huber.

- -- --- -----=[ shuber at jahia dot com ]=---- --- -- -
CTO & Co-founder - Jahia Solutions Group, 9 Routes de Jeunes, 1227 Acacias, 
Switzerland

Jahia’s next-generation, open source CMS stems from a widely acknowledged 
vision 
of enterprise application convergence – web, search, document, social and 
portal – 
unified by the simplicity of web content management.

http://www.jahia.com

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to