<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JNDI Lookup fails with an ArrayStoreException
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/rsherzad">Rias A. Sherzad</a> in <i>EJB3</i> - <a href="http://community.jboss.org/message/635239#635239">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello everyone and "Guten Tag" from Germany :-)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I've been spending the past few days with a very strange problem that I just can't find a solution for.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We have successfully deployed our application to JBoss 5.1 and we're now trying to port it to JBoss 6.1 (with the same JDK - version 1.6.0_26). There's an <span style="font-family: 'courier new', courier;">.EAR</span>, and a a <span style="font-family: 'courier new', courier;">.WAR</span> file and, deployed into the "<span style="font-family: 'courier new', courier;">default</span>" server, JBoss starts up cleanly (registers the EJBs etc. in the JNDI tree) and the web application also loads its first page.</p><p>The problem comes up when I attempt to login. That's when the web application accesses the EJBs defined in the <span style="font-family: 'courier new', courier;">.EAR</span> file (trying to find <span style="font-family: 'courier new', courier;">UserControllerBean</span>) to load some of the information associated with the user record.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The Stacktrace I see is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">Starting Login...
[org.jnp.interfaces.TimedSocketFactory] (http-127.0.0.1-8080-5) createSocket, hostAddr: /127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
[org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory] (http-127.0.0.1-8080-5) org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory servicing request for myapp-kernel-1.0-SNAPSHOT/UserControllerBean/remote
javax.naming.NamingException: Could not dereference object [Root exception is java.lang.ArrayStoreException: org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor]
          at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1508)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:824)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
          at javax.naming.InitialContext.lookup(InitialContext.java:392)
          at com.castnote.comp.service.ComponentLocatorFactory.lookup(ComponentLocatorFactory.java:39)
          at com.castnote.comp.service.ComponentLocatorFactory.lookup(ComponentLocatorFactory.java:34)
          at com.castnote.server.core.action.AbstractAction.getUserController(AbstractAction.java:292)
          at com.castnote.server.content.LoginAction.login(LoginAction.java:95)
          at com.castnote.server.content.LoginAction.execute(LoginAction.java:62)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
          at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
          at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
          at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
          at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
          at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)
          at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
          at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ArrayStoreException: org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor
          at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
          at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
          at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:771)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:240)
          at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:157)
          at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
          at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
          at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
          ... 79 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>As far as I can tell this particular EJB has been deployed properly:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">22:12:31,516 WARN  [TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers
22:12:31,522 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=myapp-kernel-1.0-SNAPSHOT.ear,jar=myapp-kernel-ejb-1.0-SNAPSHOT.jar,name=UserControllerBean,service=EJB3
22:12:31,529 INFO  [EJBContainer] STARTED EJB: com.myapp.comp.user.controller.UserControllerBean ejbName: UserControllerBean
22:12:31,663 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
          myapp-kernel-1.0-SNAPSHOT/UserControllerBean/remote - EJB3.x Default Remote Business Interface
          myapp-kernel-1.0-SNAPSHOT/UserControllerBean/remote-com.mycompany.sys.control.AbstractStatelessController - EJB3.x Remote Business Interface
          myapp-kernel-1.0-SNAPSHOT/UserControllerBean/remote-com.myapp.comp.user.controller.UserController - EJB3.x Remote Business Interface
          myapp-kernel-1.0-SNAPSHOT/UserControllerBean/local - EJB3.x Default Local Business Interface
          myapp-kernel-1.0-SNAPSHOT/UserControllerBean/local-com.myapp.comp.user.controller.UserControllerLocal - EJB3.x Local Business Interface
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have to add that <span style="font-family: 'courier new', courier;">myapp-portal.war/WEB-INF/lib</span> contains <span style="font-family: 'courier new', courier;">myapp-kernel-ejb-1.0-SNAPSHOT.jar</span> (the <span style="font-family: 'courier new', courier;">.WAR</span> needs this <span style="font-family: 'courier new', courier;">.JAR </span>as it used the classes in it), which is the same file that is also present in the root of <span style="font-family: 'courier new', courier;">myapp-kernel-1.0-SNAPSHOT.ear</span>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm using Maven but not the "skinny WAR"-approach so lots of other libraries that are present and used in the <span style="font-family: 'courier new', courier;">.EAR</span> file are also in the <span style="font-family: 'courier new', courier;">.WAR</span> file's <span style="font-family: 'courier new', courier;">WEB-INF/lib</span> folder.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>One more thing: I also tried the "skinny WAR"-approach - didn't help. I thought if all classes are deployed from within the same artifact then the lookup would work or potential classloading issues (if this is one at all) could be evaded. I got exactly the same error message :-/</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any idea or advice could help. Thanks in advance :-)</p><p>Rias</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/635239#635239">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB3 at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>