JSF1.2 seam2 websphere 8.5.5 NullPointerException

96 Views Asked by At

We have application deployed on WebSphere 7. We want to migrate it to 8.5.5.18.

We use JSF 1.2 and Seam Framework in version 2.0.2. In jsp/jsf configuration for WebSphere we have SunRI 1.2 set in our application (just like in previous configuration on was7).

When our application starts we get error from one of our class:

org.jboss.seam.InstantiationException: Could not instantiate Seam component: myComponentName at org.jboss.seam.Component.newInstance(Component.java:1986) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892) Caused by: java.lang.NullPointerException at com.test.MyComponentName_$$_javassist_1.init(MyComponentName _$$_javassist_1.java)

Our component consists of following annotation:

@Startup 
@Name("myComponentName") 
@Scope(ScopeType.APPLICATION) 

Public class MyComponentName

As we debug we noticed that exception is thrown during application scope instantiation (application start):

public Object wrap(Object bean, MethodHandler interceptor) throws Exception { 
    ProxyObject proxy = (ProxyObject)this.getProxyFactory().newInstance(); 
    proxy.setHandler(interceptor); 
    return proxy; 
} 

When newInstance() is called we will get error “Method threw ‘java.lang.NullPinterException’ exception. Cannot evaluate com.test.MyComponentName__$$__javassist_1.toString()”

We know there is no error in our code because it works on Was7. Also this will happen with Session scope when ConversationalIdGenerator is called.

00000178 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[Faces Servlet]: java.lang.NullPointerException at org.jboss.seam.core.ConversationIdGenerator_$$javassist_3.getNextId(ConversationIdGenerator$$_javassist_3.java) at org.jboss.seam.util.Id.nextId(Id.java:10) at org.jboss.seam.core.Manager.generateInitialConversationId(Manager.java:536) at org.jboss.seam.faces.FacesManager.generateInitialConversationId(FacesManager.java:134) at org.jboss.seam.core.Manager.initializeTemporaryConversation(Manager.java:528) at org.jboss.seam.web.PatchedExceptionFilter.endWebRequestAfterException(PatchedExceptionFilter.java:105) at org.jboss.seam.web.PatchedExceptionFilter.doFilter(PatchedExceptionFilter.java:73)

As we debug, we noticed that classes with @BypassInterceptors annotation works fine, so we assume that the problem is with javassist proxy object that cannot be instantiated.

We tried to add javassist.jar from websphere 7. We tried add javassist.jar as isolated classloader (with and without changing of applicationClassLoadingMode PARENT_FIRST/PARENT_LAST).

We also saved to .class file generated javassist_$$ of type javassist.bytecode.ClassFile in both Was7 and Was8.5.5 and after decompilation we compare them. No difference was found.

In WAS8 we tried copy libs from seam framework into our application lib folder.

We also changed logs to have extended classLoader logging by adding -Dibm.cl.verbose but it didn't give any additional information.

1

There are 1 best solutions below

0
F Rowe On

Follow the instructions in this IBM KC topic to configure the server to use an impl of JSF other than the one shipped with the server, in particular the last paragraph of the topic.