<!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">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;">
Error working wih EJB3, Struts2 & JBoss 4.2GA
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/nk_2010">NAG Kum</a> in <i>EJB 3.0</i> - <a href="http://community.jboss.org/message/537190#537190">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi All,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/>Nice chatting with you all...:) Facing below error - while accessing struts 2 action from browser - <br/>************************************************<br/>java.lang.reflect.InvocationTargetException<br/>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>java.lang.reflect.Method.invoke(Method.java:597)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)<br/>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)<br/>org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)<br/>org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)<br/>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)<br/>org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/>root cause</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>java.lang.NoClassDefFoundError: Could not initialize class $Proxy146<br/>sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br/>sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)<br/>sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)<br/>java.lang.reflect.Constructor.newInstance(Constructor.java:513)<br/>org.jboss.ejb3.stateful.StatefulLocalProxyFactory.createProxy(StatefulLocalProxyFactory.java:150)<br/>org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:53)<br/>javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)<br/>org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1273)<br/>org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1290)<br/>org.jnp.interfaces.NamingContext.lookup(NamingContext.java:763)<br/>org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)<br/>javax.naming.InitialContext.lookup(InitialContext.java:392)<br/>com.tarangtech.framework.ejb.clients.util.CommonPaymentAction.getAuthentication(CommonPaymentAction.java:27)<br/>com.tarangtech.mtg.authentication.struts.AuthenticationAction.execute(AuthenticationAction.java:23)<br/>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>java.lang.reflect.Method.invoke(Method.java:597)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)<br/>com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)<br/>com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)<br/>com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)<br/>org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)<br/>org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)<br/>org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)<br/>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)<br/>org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br/>************************************************</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Please find my code below - to look up a EJB -</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>static TreeMap<String, String[]> getAuthentication(XmlHandlerRequestASM objReqHandAsm){</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>map = new TreeMap<String, String[]>();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>try {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>ctx = new InitialContext();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>AuthenticationBean authEjb = (AuthenticationBean)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>ctx.lookup("AuthenticationLocal");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>XmlHandlerResponseASM objRespASM = authEjb.doLoginAdm(objReqHandAsm);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>key = Constants.AdminConstants.authentication;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>if(objRespASM.getStatus().get(Constants.Communication.STATUSCODE) != null ) {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>values[0] = (String) objRespASM.getStatus().get(Constants.Communication.STATUSCODE);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>else if(objRespASM.getStatus().get(Constants.Communication.ERRORCODE) != null ) {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>values[0] = (String) objRespASM.getStatus().get(Constants.Communication.ERRORCODE);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>else {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>values[0] = "input";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>map.put(key,values);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>catch (NamingException e) {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>//LoggerHelper.log(arg0, arg1, arg2, arg3)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>e.printStackTrace();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>catch (NullPointerException e) {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>// TODO Auto-generated catch block</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>e.printStackTrace();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>catch (TarangFrameworkException e) {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>// TODO Auto-generated catch block</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>e.printStackTrace();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>return map;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Below is the AuthenticationBean class ::</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Stateful</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Local</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>(AuthenticationLocal.class)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@LocalBinding</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>(jndiBinding="AuthenticationLocal")</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Remote</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>(Authentication.class)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@RemoteBinding</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>(jndiBinding="Authentication")</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>class AuthenticationBean implements AuthenticationLocal{</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Appreciate any ideas to resolve my application issue.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance..<br/>NK</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/537190#537190">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB 3.0 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>