[EJB 3.0 Users] - java.rmi.ServerException: RemoteException
by 2vm
Hi
I am new to this community.I having a problem while accessing stateless session bean from client code.
I am using JBOSS 4.0.2
Following is the stack trace
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
null
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy0.create(Unknown Source)
at com.oneview.configure.delegate.ConfigureDelegate.getRemoteInstance(ConfigureDelegate.java:447)
at com.oneview.configure.delegate.ConfigureDelegate.fetchAllCameraDetail(ConfigureDelegate.java:59)
at com.oneview.configure.action.ConfigureCameraAction.processShowConfigureCameraView(ConfigureCameraAction.java:94)
at com.oneview.configure.action.ConfigureCameraAction.showConfigureCameraView(ConfigureCameraAction.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
null
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:125)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
at org.jboss.ejb.Container.invoke(Container.java:894)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
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:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
null
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
****************************************************
Following is my client code
private ConfigureRemoteInterface getRemote() {
ConfigureRemoteInterface configureRemoteInterface = null;
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, "localhost:1099");
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext ctx = null;
try {
ctx = new InitialContext(p);
} catch (NamingException e) {
e.printStackTrace();
}
Object obj = null;
try {
obj = ctx.lookup("ejb/ConfigureJndi");
} catch (NamingException e) {
e.printStackTrace();
}
if(obj instanceof ConfigureHomeInterface){
}else if(obj instanceof ConfigureRemoteInterface){
System.out.println(ConfigureCameraAction.class.getName()+">>>>>>>>>>>>OBJ IS OBJECT>>>>>>>>>");
}
ConfigureHomeInterface configureHomeInterface=null;
configureHomeInterface = (ConfigureHomeInterface) PortableRemoteObject
.narrow(obj, ConfigureHomeInterface.class);
try {
configureRemoteInterface = configureHomeInterface.create();
} catch (RemoteException e) {
e.printStackTrace();
} catch (CreateException e) {
e.printStackTrace();
}
return configureRemoteInterface;
}
*****************************************
HOME class as follows
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface ConfigureHomeInterface extends EJBHome {
public ConfigureRemoteInterface create() throws RemoteException, CreateException;
}
*******************************************
Remote as folows
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
public interface ConfigureRemoteInterface extends EJBObject {
public String sayHello() throws RemoteException,DataHandlerException ;
public void ejbCreate(){}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void setSessionContext
(SessionContext sc ) {}
}
Any help at the earliest is always welcome :)
Thanks in advance !
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262851#4262851
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262851
16 years, 6 months
[JBoss Web Services Users] - WSDL generated incorrectly?
by Elenthril
Hi,
I am using wstools from eclipse 3.5.1. and jboss-5.1.0.GA to generate a top-down webservice. It is generated from the following, I believe (syntacticly) correct, wsdl with <mime:multipartRelated> elements.
| <?xml version="1.0" encoding="UTF-8"?>
| <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
| xmlns:tns="http://com.lei.nl/modelAgent"
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
| xmlns:lei="http://com.lei.nl/modelAgent"
| name="ModelAgentService"
| targetNamespace="http://com.lei.nl/modelAgent">
| <wsdl:types>
| <xsd:schema xmlns:lei="http://com.lei.nl/modelAgent" targetNamespace="http://com.lei.nl/modelAgent" >
| <xsd:element name="ModelAgentRequest">
| <xsd:complexType>
| <xsd:sequence>
| <xsd:element minOccurs="1" maxOccurs="1" name="modelType" type="xsd:string"/>
| <xsd:element minOccurs="1" maxOccurs="1" name="modelName" type="xsd:string"/>
| <xsd:element minOccurs="0" maxOccurs="unbounded" name="modelParameters" type="lei:ModelParameter"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:element>
| <xsd:element name="ModelAgentResponse">
| <xsd:complexType>
| <xsd:sequence>
| <xsd:element minOccurs="1" maxOccurs="1" name="returnCode" type="xsd:string"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:element>
| <xsd:complexType name="ModelParameter">
| <xsd:sequence>
| <xsd:element minOccurs="1" name="parameterName" type="xsd:string"/>
| <xsd:element minOccurs="1" name="parameterValue" type="xsd:string"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:schema>
| </wsdl:types>
| <wsdl:message name="invokeRequestMsg">
| <wsdl:part name="ModelAgentRequest" element="lei:ModelAgentRequest"/>
| <wsdl:part name="gdxAttachment" type="xsd:base64Binary"/>
| </wsdl:message>
| <wsdl:message name="invokeResponseMsg">
| <wsdl:part name="ModelAgentResponse" element="lei:ModelAgentResponse"/>
| <wsdl:part name="gdxAttachment" type="xsd:base64Binary"/>
| </wsdl:message>
| <wsdl:portType name="ModelAgentService">
| <wsdl:operation name="invoke">
| <wsdl:input message="tns:invokeRequestMsg" name="invokeRequestMsg"/>
| <wsdl:output message="tns:invokeResponseMsg" name="invokeResponseMsg"/>
| </wsdl:operation>
| </wsdl:portType>
| <wsdl:binding name="ModelAgentServiceSOAP" type="tns:ModelAgentService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <wsdl:operation name="invoke">
| <soap:operation soapAction=""/>
| <wsdl:input name="invokeRequestMsg">
| <mime:multipartRelated>
| <mime:part>
| <soap:body parts="ModelAgentRequest" use="literal"/>
| </mime:part>
| <mime:part>
| <mime:content part="gdxAttachment" type="application/octet-stream"/>
| </mime:part>
| </mime:multipartRelated>
| </wsdl:input>
| <wsdl:output name="invokeResponseMsg">
| <mime:multipartRelated>
| <mime:part>
| <soap:body parts="ModelAgentResponse" use="literal"/>
| </mime:part>
| <mime:part>
| <mime:content part="gdxAttachment" type="application/octet-stream"/>
| </mime:part>
| </mime:multipartRelated>
| </wsdl:output>
| </wsdl:operation>
| </wsdl:binding>
| <wsdl:service name="ModelAgentSOAPService">
| <wsdl:port binding="tns:ModelAgentServiceSOAP" name="ModelAgentServiceSOAP">
| <soap:address location="http://localhost:9080/ModelAgentWeb/services/ModelAgentServiceSOAP"/>
| </wsdl:port>
| </wsdl:service>
| </wsdl:definitions>
|
All the classes are generated coorectly. However, the wsdl published by JBoss look like this
definitions name="ModelAgentService" targetNamespace="http://com.lei.nl/modelAgent" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://com.lei.nl/modelAgent" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://modelagent.lei.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <types>
| <xs:schema targetNamespace="http://com.lei.nl/modelAgent" version="1.0" xmlns:tns="http://com.lei.nl/modelAgent" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="ModelAgentRequest">
| <xs:complexType>
| <xs:sequence>
| <xs:element name="modelType" type="xs:string" />
| <xs:element name="modelName" type="xs:string" />
| <xs:element maxOccurs="unbounded" minOccurs="0" name="modelParameters" nillable="true" type="tns:ModelParameter" />
| </xs:sequence>
| </xs:complexType>
| </xs:element>
| <xs:element name="ModelAgentResponse">
| <xs:complexType>
| <xs:sequence>
| <xs:element name="returnCode" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| </xs:element>
| <xs:element name="gdxAttachment" nillable="true" type="xs:base64Binary" />
| <xs:complexType name="ModelParameter">
| <xs:sequence>
| <xs:element name="parameterName" type="xs:string" />
| <xs:element name="parameterValue" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="ModelAgentService_invoke">
| <part element="ns1:gdxAttachment" name="gdxAttachment" />
| </message>
| <message name="ModelAgentService_invokeResponse">
| <part element="ns1:gdxAttachment" name="gdxAttachment" />
| </message>
| <portType name="ModelAgentService">
| <operation name="invoke" parameterOrder="ModelAgentRequest gdxAttachment">
| <input message="ns1:ModelAgentService_invoke" />
| <output message="ns1:ModelAgentService_invokeResponse" />
| </operation>
| </portType>
| <binding name="ModelAgentServiceBinding" type="ns1:ModelAgentService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
| <operation name="invoke">
| <soap:operation soapAction="" />
| <input>
| <soap:body use="literal" />
| </input>
| <output>
| <soap:body use="literal" />
| </output>
| </operation>
| </binding>
| </definitions>
|
What happened here is the first parts of the request and response messages are lost, and cannot therefore not be read a client.
Has anyone any idea what i am doing wrong?
Thnak you
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262849#4262849
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262849
16 years, 6 months