[JBossWS] - Error: Could not transmit message
by paoletto
Hello! I get this error i dont get why.
I followed the jbossws manual and sample code.
What i did:
App A expose a session bean correctly (it works, i tested it already, but in a wrong way which worked only on the same AS).
App B has a session bean as session endpoint interface. i generated both client and server artifacts with wstool and sample config.xml from manual. I imported in App B value type classes and other .java artifacts, and the jaxrpc-mapping.xml.
Im trying to connect using DII configured client tecnique since i have to connect to more than 1 web service in sequence.
Im using jbossAS 4.0.5 and im following examples from -samples-1.0.3GA.zip
here's the code: (please note the jaxrpc mapping is being found)
| package servizioAteneo.ejb;
|
| import java.rmi.RemoteException;
| import javax.naming.Context;
|
| import javax.naming.InitialContext;
| import javax.rmi.PortableRemoteObject;
| import javax.ejb.EJBException;
| import javax.ejb.SessionBean;
| import javax.ejb.SessionContext;
| import javax.ejb.CreateException;
| import java.io.*;
| import javax.xml.rpc.Stub;
| import servizioAteneo.ejb.*;
| import servizioAteneo.interfaces.*;
| import javax.xml.rpc.Service;
| import javax.xml.rpc.Call;
| import javax.xml.rpc.ServiceFactory;
| import javax.xml.namespace.QName;
| import java.net.URL;
| import java.util.*;
|
| import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
| import org.jboss.ws.jaxrpc.ServiceImpl;
|
| import org.serviziodipartimentale.*;
|
| public class SearchFrontendBean implements SessionBean {
|
| private static final String TARGET_NAMESPACE = "http://servizioDipartimentale.org/";
| private Context ctx = null;
| private javax.ejb.SessionContext context;
|
| private AutenticazioneAteneoHome home = null;
| private AutenticazioneAteneo bean = null;
|
|
| public SearchFrontendBean() throws Exception {
| super();
| try {
| ctx = new InitialContext();
| } catch (Exception e) { throw new EJBException("generating context failed"); }
| try {
| Object ref = ctx.lookup("java:comp/env/ejb/AutenticazioneAteneo");
| home = (AutenticazioneAteneoHome) PortableRemoteObject.narrow(ref,AutenticazioneAteneoHome.class);
| bean = home.create();
| } catch (Exception e) { throw new EJBException("Lookup of java comp env failed"); }
| }
|
| public void setSessionContext(SessionContext ctx)
| throws EJBException,
| RemoteException {
| this.context = ctx;
|
| }
|
| public void ejbRemove() throws EJBException, RemoteException {
| // TODO Auto-generated method stub
|
| }
|
| public void ejbActivate() throws EJBException, RemoteException {
| // TODO Auto-generated method stub
|
| }
|
| public void ejbPassivate() throws EJBException, RemoteException {
| // TODO Auto-generated method stub
|
| }
|
| public void ejbCreate() throws CreateException {
| // TODO Auto-generated method stub
| }
|
| private Call getRemoteInterface(String domain, String port) {
| Call ricerca;
| URL wsdl = null;
| QName qname = null;
|
| try {
| wsdl = new URL("http://" + domain +":" + port + "/ServizioEJB/Ricerca?wsdl");
| qname = new QName(TARGET_NAMESPACE,"Ricerca");
| } catch (Exception e) {
| System.out.println("URL creating error");
| return null;
| }
|
|
| this.getClass().getResourceAsStream( "lib/jaxrpc-mapping-client.xml" );
|
| /*
| File javaWsdlMappingFile = new File("/lib/jaxrpc-mapping-client.xml");
|
| if (! javaWsdlMappingFile.canRead()) {
| System.out.println("no wsdl");
| return null;
| } */
|
| URL url = this.getClass().getResource("/jaxrpc-mapping-client.xml");
| if (url == null) {
| System.out.println("no wsdl: url is null");
| return null;
| } else System.out.println(url);
|
| ServiceFactoryImpl factory = new ServiceFactoryImpl();
|
| try {
| ServiceImpl service = (ServiceImpl)factory.createService(wsdl, qname, url);
| ricerca = service.createCall();
| } catch (Exception e) {
| System.out.println("getRemoteINterface() failed getting service");
| e.printStackTrace();
| return null;
| }
|
|
| /*
| ServiceFactory factory =null;
| try {
| factory = ServiceFactory.newInstance();
| } catch (Exception e) {
| System.out.println("errore serviceFactory");
| e.printStackTrace();
| return null;
| }
|
| Service service = null;
| try {
| service = factory.createService(wsdl, qname);
| ricerca = (Ricerca) service.getPort(Ricerca.class);
| } catch (Exception e){
| System.out.println("errore createService");
| e.printStackTrace();
| return null;
| } */
|
| return ricerca;
| }
|
| public org.serviziodipartimentale.Documento[] RicercaDipartimento(java.lang.String domain,
| java.lang.String port) {
|
| Documento documenti[] = null;
| Call ricerca = getRemoteInterface(domain, port);
| if ( ricerca == null) return null;
|
| try {
| QName operationName = new QName(TARGET_NAMESPACE, "catalogoPubblicazioni");
| ricerca.setOperationName(operationName);
| //documenti = ricerca.catalogoPubblicazioni();
|
| documenti = (Documento[]) ricerca.invoke(null);
|
| } catch (Exception e) {
| e.printStackTrace();
| return null;
| }
|
| return documenti;
| }
| /**
| * Business method
| * @ejb.interface-method view-type = "remote"
| */
| public void RicercaAutore(String autore) {
| // TODO Auto-generated method stub
| }
| /**
| * Business method
| * @ejb.interface-method view-type = "remote"
| */
| public void RicercaKeyword(String keyword) {
| // TODO Auto-generated method stub
| }
|
| public DocumentoAteneo[] RicercaKeywords(String keyword[]) {
| Collection dipartimenti = null;
| DocumentoAteneo result[] = null;
| Collection res = new ArrayList();
| Call ricerca = null;
| Iterator itDip = null;
|
| try {
| dipartimenti = bean.elencaDipartimenti();
| } catch (Exception e) {e.printStackTrace(); return null; }
|
| if (dipartimenti != null) {
| itDip = dipartimenti.iterator();
| } else return null;
|
| while(itDip.hasNext()) {
| DipartimentoAteneoLocal dip = (DipartimentoAteneoLocal) itDip.next();
| ricerca = getRemoteInterface(dip.getDomain(), dip.getPort());
|
| if (ricerca != null) {
| Documento[] tmp = null;
| try {
| QName operationName = new QName(TARGET_NAMESPACE, "searchByKeywords");
| ricerca.setOperationName(operationName);
|
| tmp = (Documento[]) ricerca.invoke(new Object[]{Integer.valueOf(keyword.length),keyword});
|
| //tmp = ricerca.searchByKeywords(keyword.length,keyword);
| } catch (Exception e) {
| e.printStackTrace();
| tmp = null;
| }
| if (tmp != null) {
| DocumentoAteneo doc;
|
| for (int i=0; i<tmp.length; i++) {
| Documento d = tmp;
| doc = new DocumentoAteneo(d.getId(),d.getTitolo(),d.getAnno(),
| d.getDescrizione(),d.getTipo(),dip.getNome());
| res.add(doc);
| }
| }
| }
| }
| res.toArray((result = new DocumentoAteneo[res.size()]));
| return result;
| }
|
and here's the error:
| 13:09:25,904 INFO [STDOUT] jar:file:/local/public/jboss-4.0.5.GA/server/default/tmp/deploy/tmp44961AteneoApp.ear-contents/AteneoEJB.jar!/jaxrpc-mapping-client.xml
| 13:09:27,937 ERROR [CallImpl] Call invocation failed with unkown Exception
| javax.xml.soap.SOAPException: Could not transmit message
| at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:204)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:687)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
| at servizioAteneo.ejb.SearchFrontendBean.RicercaKeywords(SearchFrontendBean.java:269)
| 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.invocation.Invocation.performCall(Invocation.java:359)
| at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
| at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
| at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
| at org.jboss.ejb.Container.invoke(Container.java:954)
| 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:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
| at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
| at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
| at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| at $Proxy196.RicercaKeywords(Unknown Source)
| at servizioAteneo.web.RicercaServlet.doGet(RicercaServlet.java:89)
| at servizioAteneo.web.RicercaServlet.doPost(RicercaServlet.java:112)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:201)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:81)
| at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
| at org.jboss.remoting.Client.invoke(Client.java:525)
| at org.jboss.remoting.Client.invoke(Client.java:488)
| at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:189)
| ... 61 more
| Caused by: java.net.UnknownHostException: fornost
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
| at java.net.Socket.connect(Socket.java:507)
| at java.net.Socket.connect(Socket.java:457)
| at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
| at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
| at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
| at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
| at sun.net.www.http.HttpClient.New(HttpClient.java:287)
| at sun.net.www.http.HttpClient.New(HttpClient.java:299)
| at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
| at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
| at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
| at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:163)
| ... 66 more
| 13:09:27,972 ERROR [STDERR] java.rmi.RemoteException: Call invocation failed: Could not transmit message; nested exception is:
| javax.xml.soap.SOAPException: Could not transmit message
| 13:09:27,974 ERROR [STDERR] at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:718)
| 13:09:27,975 ERROR [STDERR] at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
| 13:09:27,976 ERROR [STDERR] at servizioAteneo.ejb.SearchFrontendBean.RicercaKeywords(SearchFrontendBean.java:269)
| 13:09:27,977 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 13:09:27,978 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 13:09:27,979 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 13:09:27,980 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 13:09:27,981 ERROR [STDERR] at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
| 13:09:27,982 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
| 13:09:27,982 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
| 13:09:27,983 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
| 13:09:27,984 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
| 13:09:27,984 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
| 13:09:27,985 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| 13:09:27,986 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
| 13:09:27,986 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
| 13:09:27,987 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
| 13:09:27,990 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
| 13:09:27,991 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
| 13:09:27,991 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:954)
| 13:09:27,993 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 13:09:27,994 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 13:09:27,994 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 13:09:27,995 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 13:09:27,996 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| 13:09:27,997 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| 13:09:27,997 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| 13:09:27,998 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| 13:09:27,999 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 13:09:27,999 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
| 13:09:28,000 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
| 13:09:28,001 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
| 13:09:28,002 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
| 13:09:28,002 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
| 13:09:28,003 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| 13:09:28,004 ERROR [STDERR] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
| 13:09:28,005 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| 13:09:28,006 ERROR [STDERR] at $Proxy196.RicercaKeywords(Unknown Source)
| 13:09:28,006 ERROR [STDERR] at servizioAteneo.web.RicercaServlet.doGet(RicercaServlet.java:89)
| 13:09:28,007 ERROR [STDERR] at servizioAteneo.web.RicercaServlet.doPost(RicercaServlet.java:112)
| 13:09:28,008 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| 13:09:28,008 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 13:09:28,009 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 13:09:28,011 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 13:09:28,012 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 13:09:28,012 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 13:09:28,013 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 13:09:28,016 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 13:09:28,017 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 13:09:28,018 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| 13:09:28,018 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 13:09:28,019 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 13:09:28,035 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 13:09:28,037 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| 13:09:28,037 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 13:09:28,038 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 13:09:28,039 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| 13:09:28,039 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 13:09:28,040 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 13:09:28,041 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 13:09:28,041 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 13:09:28,042 ERROR [STDERR] Caused by: javax.xml.soap.SOAPException: Could not transmit message
| 13:09:28,043 ERROR [STDERR] at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:204)
| 13:09:28,044 ERROR [STDERR] at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:687)
| 13:09:28,060 ERROR [STDERR] ... 60 more
| 13:09:28,061 ERROR [STDERR] Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
| 13:09:28,062 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:201)
| 13:09:28,063 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:81)
| 13:09:28,064 ERROR [STDERR] at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
| 13:09:28,066 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:525)
| 13:09:28,067 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:488)
| 13:09:28,069 ERROR [STDERR] at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:189)
| 13:09:28,069 ERROR [STDERR] ... 61 more
| 13:09:28,070 ERROR [STDERR] Caused by: java.net.UnknownHostException: fornost
| 13:09:28,071 ERROR [STDERR] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
| 13:09:28,071 ERROR [STDERR] at java.net.Socket.connect(Socket.java:507)
| 13:09:28,072 ERROR [STDERR] at java.net.Socket.connect(Socket.java:457)
| 13:09:28,075 ERROR [STDERR] at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
| 13:09:28,076 ERROR [STDERR] at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
| 13:09:28,076 ERROR [STDERR] at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
| 13:09:28,077 ERROR [STDERR] at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
| 13:09:28,078 ERROR [STDERR] at sun.net.www.http.HttpClient.New(HttpClient.java:287)
| 13:09:28,078 ERROR [STDERR] at sun.net.www.http.HttpClient.New(HttpClient.java:299)
| 13:09:28,079 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
| 13:09:28,093 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
| 13:09:28,094 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
| 13:09:28,094 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
| 13:09:28,095 ERROR [STDERR] at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:163)
| 13:09:28,096 ERROR [STDERR] ... 66 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080848#4080848
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080848
18 years, 7 months
[JBoss Seam] - IllegalStateException: No Transaction: what have I missed?
by weliwarmer
Hi,
I am maintaining someone else's code that uses JBoss Seam 1.1.0 GA. I'm just struggling with loading a DataModel: an IllegalStateException is thrown when the database query is run, stating that there is "No Transaction". I have just copied an existing, working bean so if someone could point out what I have missed, I would be grateful.
Thanks, Tim
Stack Trace....
anonymous wrote :
| java.lang.IllegalStateException: No transaction.
| at org.jboss.tm.TxManager.setRollbackOnly(TxManager.java:751)
| at org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java:392)
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:545)
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
| at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:90)
| at org.jboss.ejb3.entity.ExtendedEntityManager.createNamedQuery(ExtendedEntityManager.java:134)
Session Bean.....
| @Stateful
| @Name("blogFinder")
| @Scope(ScopeType.CONVERSATION)
| @TransactionAttribute(NOT_SUPPORTED)
| public class BlogFinderAction implements BlogFinder, Serializable {
|
| ...
|
| @PersistenceContext(type = EXTENDED)
| private EntityManager em;
|
| @DataModel
| private List<Blog> latestBlogs;
|
| @DataModelSelection("latestBlogs")
| @Out(required = false, scope = ScopeType.CONVERSATION)
| private Blog latestBlog;
|
| @SuppressWarnings("unchecked")
| @Factory("latestBlogs")
| public void doBlogSearch() {
| latestBlogs = null;
| latestBlogs = em.createNamedQuery("blog.findAll").getResultList();
| logger.debug("Retrieving articles for " + latestBlogs.size()
| + " blogs");
| }
... entity bean .....
| @Entity
| @Table(name="Blogs")
|
| @NamedQueries(value=
| {
| @NamedQuery(name="findAll",
| query="SELECT " +
| " a " +
| "FROM " +
| " Blog AS a ")
| }
|
| )
|
| public class Blog implements Serializable {
|
| private static final Logger LOG = Logger.getLogger(Blog.class) ;
|
| private String url;
|
| @Id
| @Column(name="URL")
| @Length(min=0, max=1000, message="URL must be between 0 and 1000 characters.")
| public String getUrl() {
| return url ;
| }
|
| public void setUrl(String url) {
| this.url = url ;
| }
| }
.... jsf ....
| <t:dataList value="#{latestBlogs}" var="blogArticle" rendered="#{not empty latestBlogs}">
| article...
| #{blogArticle.url}
| </t:dataList>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080843#4080843
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080843
18 years, 7 months
[JBoss Getting Started Documentation] - javax.naming.NamingException : could not dereference object[
by ashwinD
HI Someone please help me i am new to entity beans. I deployed my application successfully to jboss-4.0.4.GA server (default) i don't have ejb3 support. In my application i want to display the records of Book table (Library database)from mysql. So i created 1st entity bean first & then i developed servlet & run xdoclet after creating interfaces i make all possible changes & lastly managed to deployed the application
Now my problem is that when i request the servlet "ReadData" through browser then Exception is arises.
i am using
JBoss IDE1.6
JBoss 4.0.4.GA server
mysql 5 with mysql connector
Debian Etch
my deployment descriptors are:
ejb-jar.xml is
<ejb-jar >
<![CDATA[No Description.]]>
<display-name>exampleBMPJAR</display-name>
<enterprise-beans>
<![CDATA[Description for exampleBMP]]>
<display-name>Name for exampleBMP</display-name>
<ejb-name>exampleBMP</ejb-name>
example.BMP.interfaces.exampleBMPHome
example.BMP.interfaces.exampleBMP
<local-home>example.BMP.interfaces.exampleBMPLocalHome</local-home>
example.BMP.interfaces.exampleBMPLocal
<ejb-class>example.BMP.ejb.exampleBMPBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>example.BMP.interfaces.exampleBMPPK</prim-key-class>
False
<resource-ref>
<res-ref-name>jdbc/bmp-exBMP</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</ejb-jar>
jboss.xml is
<enterprise-beans>
<ejb-name>exampleBMP</ejb-name>
<jndi-name>exampleBMPBean</jndi-name>
</enterprise-beans>
jboss-web.xml is
<jboss-web>
<ejb-ref>
<ejb-ref-name>ejb/exampleBMP</ejb-ref-name>
<jndi-name>ejb/exampleBMPBean</jndi-name>
</ejb-ref>
</jboss-web>
web.xml is
<servlet-name>ReadData</servlet-name>
<display-name>Name for ReadData</display-name>
<![CDATA[Description for ReadData]]>
<servlet-class>example.BMP.Web.ReadData</servlet-class>
<servlet-mapping>
<servlet-name>ReadData</servlet-name>
<url-pattern>/ReadData</url-pattern>
</servlet-mapping>
<ejb-ref >
<![CDATA[Reference to the exampleBMP EJB]]>
<ejb-ref-name>ejb/exampleBMP</ejb-ref-name>
<ejb-ref-type>BMP</ejb-ref-type>
example.BMP.interfaces.exampleBMPHome
example.BMP.interfaces.exampleBMP
<local-home>example.BMP.interfaces.exampleBMPLocalHome</local-home>
example.BMP.interfaces.exampleBMPLocal
</ejb-ref>
</web-app>
My "ReadData" Servlet is
public class ReadData extends HttpServlet {
exampleBMPHome home;
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException
{ resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
try{
Context ctx =new InitialContext();
Object obj =ctx.lookup("java:/comp/env/ejb/exampleBMP");
exampleBMPHome home =(exampleBMPHome)PortableRemoteObject.narrow(obj,exampleBMPHome.class);
ResultSet rs=home.DisplayData();String s1 = rs.getString("BName");
String s2 = rs.getString("BAuthor");
int s3 = rs.getInt("BPrice");
int s4 = rs.getInt("LCno");
while(rs.next())
{
out.print("");
out.print("============================================");
out.println("<h3><FONT COLOR=RED> The Book Name is =</h3><h2>"+s1);
out.print("</h2>");
out.println("<h3><FONT COLOR=RED> The Author Name is =</h3><h2>"+s2);
out.print("</h2>");
out.println("<h3><FONT COLOR=RED> The Price of Book is =</h3><h2>"+s3);
out.print("</h2>");
out.println("<h3><FONT COLOR=RED> The Library card No. is=</h3><h2>"+s4);
out.print("</h2>");
out.println("==============================================");
out.print("");
out.print("");
}
}
catch(Exception e){
System.out.println("The Exception arises is ="+e);
}
finally {
out.println("");
out.close();
}
}
}
my interfaces r
exampleBMP is
public interface exampleBMP extends javax.ejb.EJBObject
{
}
& same exampleBMPLocal interface
exampleBMPHome is
public interface exampleBMPHome extends javax.ejb.EJBHome
{
public static final String COMP_NAME="java:comp/env/ejb/exampleBMP";
public static final String JNDI_NAME="exampleBMP";
public example.BMP.interfaces.exampleBMP create()throws javax.ejb.CreateException,java.rmi.RemoteException; public example.BMP.interfaces.exampleBMP findByPrimaryKey(exampleBMPPK key) throws javax.ejb.FinderException, java.rmi.RemoteException;
public ResultSet DisplayData() throws java.rmi.RemoteException;
}
and same exampleBMPLocalHome interface
Nw what is the exact problem in servlet coding where i put
Object obj =ctx.lookup("java:/comp/env/ejb/exampleBMP");
whether this is creating problem me as::
javax.naming.NamingException : could not dereference object[Root cause is javax.naming.NameNotFoundException:ejb not bound]
Please Help me.....Ashwin Dhiware BE(Computers)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080835#4080835
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080835
18 years, 7 months