I developed a java soap client using cxf. this application works fine on mac where i run it with its included jdk v6. The service i create, for example uploads images to a magento installation but here I shall introduce the problem.
In Apache Cxf I turned of chunking to avoid "crippled" xml requests.
Now I experienced that this my client-app won't run on linux distributions like ubuntu, because of the open jdk. I tested this on my mac by installing openjdk 7 and oracle jdk 7 and the same error appeared.
Still, I turned of chunking the request from the client gets sliced somewhere and the upload therefore fails.
I read this could be an issue with openjdk and some xml-libs, but i can't find any really precise or even helpful information about this topic.
Maybe someone of you might help me out.
Thanks in advance.
This is the request and the response:
ID: 5
Address: http://dev.magento.com/index.php/api/v2_soap/index/
Encoding: UTF-8
Content-Type: text/xml
Headers: {Accept=[*/*],
SOAPAction=[""]}
Messages: Outbound Message (saved to tmp file):
Filename:
/var/folders/z6/91v2ntss00s1786v_1_5y2540000gn/T/cxf-tmp-636617/cos5007091721474555391tmp
(message truncated to 102400 bytes)
Payload:
552f069112dde557bc577735fc4eb8bf
5540
/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gODAK/9sAQwAGBAUGBQQ
--------------------------------------
14168 [main] INFO
org.apache.cxf.services.MagentoService.Mage_Api_Model_Server_Wsi_HandlerPort.Mage_Api_Model_Server_Wsi_HandlerPortType
- Inbound Message
----------------------------
ID: 5
Response-Code: 200
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {Cache-Control=[max-age=31536000], connection=[close],
Content-Length=[275], content-type=[text/xml; charset=UTF-8],
Date=[Fri, 17 Aug 2012 12:52:16 GMT], Expires=[Sat, 17 Aug 2013
12:52:16 GMT], Server=[Apache], Vary=[Accept-Encoding]}
Payload:
102
Ungültiger Bildtyp.
--------------------------------------
Here is a trace:
javax.xml.ws.soap.SOAPFaultException: unsupported imagetype
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
at $Proxy28.catalogProductAttributeMediaCreate(Unknown Source)
at at.myproject.soap.service.product.media.ProductAttributeMediaServiceImpl.create(ProductAttributeMediaServiceImpl.java:61)
at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.updateProduct(ProductSyncServiceImpl.java:275)
at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.updateProducts(ProductSyncServiceImpl.java:185)
at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.syncronize(ProductSyncServiceImpl.java:145)
at at.myproject.magento.scheduler.jobs.ProductSyncJob.execute(ProductSyncJob.java:21)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: org.apache.cxf.binding.soap.SoapFault: Ungültiger Bildtyp.
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1656)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1521)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1429)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:659)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
... 8 more
I could resolve this issue by adding those libraries to my pom,
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.1</version>
</dependency>
, after consulting the FAQs of Apache's CXF.
I ran my integration test with use of OS X's latest jdk 6 and the new openjdk7 and oracle jdk7 .
Related
This question is Not Answered.(Mark as assumed answered)
Andy Gowdy
Newbie
Andy Gowdy 31-Mar-2017 06:56
HI
I am having difficulty referencing an ear file after I have deployed it in EAP 7. I have no deployment errors but when I try to access the the ear /beans through the URL I get a 404 error. In the now deprecated JBOSS.xml the URI was configured as shown. Any help would be much appreciated. Many Thanks Andy
<jboss>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB</ejb-name>
<jndi-name>HousingFacadeEJB</jndi-name>
<local-jndi-name>LocalHousingFacadeEJB</local-jndi-name>
<call-by-value>false</call-by-value>
<!-- <configuration-name>Facade</configuration-name> -->
<clustered>false</clustered>
<port-component>
<port-component-name>HousingFacade</port-component-name>
<port-component-uri>HousingFacade/HousingFacadeEJB
</port-component-uri>
</port-component>
</session>
</enterprise-beans>
<container-configurations>
<container-configuration extends="Standard Stateless SessionBean">
<container-name>HousingFacade</container-name>
<container-pool-conf>
<MinimumSize>50</MinimumSize>
<MaximumSize>150</MaximumSize>
</container-pool-conf>
</container-configuration>
</container-configurations>
</jboss>
----------------------------------------------------------
I have replaced this with a JBOSS-EJB3.xml
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
My ejb-jar.xml
<jboss:ejb-jar>
<enterprise-beans>
<session>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
<remote>com.comino.cxm.housingfacade.HousingFacade</remote>
<local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
<local>com.comino.cxm.housingfacade.LocalHousingFacade</local>
<ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>UHDSJNDINAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>java:/UHTLIVE_2</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HousingFacadeEJB2_Live</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</jboss:ejb-jar>
JBOSS Server log extract.. I have redacted the connection addresses.
----------------------------REQUEST---------------------------
URI=/HousingFacade2_Live/HousingFacadeEJB2_Live
characterEncoding=null
contentLength=1304
contentType=[text/xml; charset=utf-8]
header=Connection=Keep-Alive
header=SOAPAction=""
header=Cache-Control=no-cache
header=Content-Type=text/xml; charset=utf-8
header=Content-Length=1304
header=User-Agent=W2
header=Host=**************
locale=[]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=*************
remoteHost=************
scheme=http
host=*******************
serverPort=8080
--------------------------RESPONSE--------------------------
contentLength=74
contentType=text/html
header=Connection=keep-alive
header=X-Powered-By=Undertow/1
header=Server=JBoss-EAP/7
header=Content-Length=74
header=Content-Type=text/html
header=Date=Fri, 31 Mar 2017 10:31:43 GMT
status=404
==============================================================
There are migration guide available, below are the two links where you can find the configuration how to migrate EJB application to JBoss EAP 7;
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/migration_guide/
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/developing_ejb_applications/
can someone please help me resolve the following exception,
<Feb 10, 2015 11:43:47 AM CST> <Error> <HTTP> <BEA-101019> <[ServletContext#1297842065[app:_auto_generated_ear_ module:dmportal path:null spec-version:3.0]] Servlet failed with an IOException.
java.io.IOException: An existing connection was forcibly closed by the remote Host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:470)
Truncated. see log file for complete stacktrace
<Feb 10, 2015 11:43:50 AM CST> <Error> <HTTP> <BEA-101020> <[ServletContext#1297842065[app:_auto_generated_ear_ module:dmportal path:null spec-version:3.0]] Servlet failed with an Exception
weblogic.servlet.internal.ServletNestedRuntimeException: Cannot parse POST parameters of request: '/dmportal/pushTime.do'
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2426)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2243)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekParameter(ServletRequestImpl.java:2462)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekPostParameter(ServletRequestImpl.java:2445)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.access$2600(ServletRequestImpl.java:2014)
Truncated. see log file for complete stacktrace
Caused By: java.net.ProtocolException: EOF after reading only: '0' of: '16' promised bytes, out of which at least: '0' were already buffered
at weblogic.servlet.internal.PostInputStream.complain(PostInputStream.java:84)
at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:189)
at weblogic.servlet.internal.ServletInputStreamImpl$1.read(ServletInputStreamImpl.java:189)
at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:251)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2400)
Truncated. see log file for complete stacktrace
<Feb 10, 2015 11:43:50 AM CST> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
java.lang.AssertionError: Assertion violated.
java.lang.AssertionError: Assertion violated
at weblogic.utils.Debug.assertion(Debug.java:58)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:2404)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2243)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekParameter(ServletRequestImpl.java:2462)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.peekPostParameter(ServletRequestImpl.java:2445)
Truncated. see log file for complete stacktrace
I am using Oracle OEPE eclipse with weblogic 12c. It was working fine before i started working on the Mobile application.
i have installed following plugins in my eclipse.
1. Android Tools
2. JBoos Hybrid Mobile tools
The following open source installed on my pc
1. Node Js
2. Cordova
3. Ripple emulator
I enabled SSL in weblogic and tried with https url and it worked fine.
You can change the url in config.xml file. then it will works.
I'm trying to create a Web Service Client using the Eclipse Juno SR2 wizard. The service is correctly deployed and running on a Glassfish 3.1.2 server and I can see the WSDL file or create the client using Axis.
The problem arises if I try to use CXF (tried CXF 2.6.8 and 2.7.5) to create the client in a Dynamic Web project created for a GLassfish 3.1.2:
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d /Users/dude/Documents/SOA/workspace/gf/.cxftmp/src -classdir /Users/dude/Documents/SOA/workspace/gf/build/classes -p http://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
wsdl2java - Apache CXF 2.6.8
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/dude/glassfish3/glassfish/modules/weld-osgi-bundle.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/apache-cxf-2.6.8/lib/slf4j-jdk14-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:97)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.java:69)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:82)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:59)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:198)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
... 4 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:243)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
... 10 more
Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:299)
at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:254)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1423)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1317)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:233)
... 12 more
If I try to execute the wsdl2java as command line it works and .java files are created:
macpro:glassfish3 dude$ /usr/local/apache-cxf-2.6.8/bin/wsdl2java -client -d /Users/dude/Documents/SOA/workspace/gf/.cxftmp/src -classdir /Users/dude/Documents/SOA/workspace/gf/build/classes -p http://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d /Users/dude/Documents/SOA/workspace/gf/.cxftmp/src -classdir /Users/dude/Documents/SOA/workspace/gf/build/classes -p http://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
wsdl2java - Apache CXF 2.6.8
I suppose there's some problem in the Eclipse+CXF combo, since the command line works, but I've no clue about how to solve it. Any idea ?
You need to make sure Woodstox 4.2.0 is being picked up. Alternatively, set the system property org.apache.cxf.stax.allowInsecureParser to true
Try removing these 2 jar files from the glassfish\modules directory:
woodstox-core-asl.jar
stax2-api.jar
I think it will prevent the 2 JAR files (woodstox and stax2) from the CXF project from being used after deployment.
Try excluding this if it exists as a dependency somewhere, and use Woodstox 4.2.0:
<artifactId>wstx-asl</artifactId>
<groupId>org.codehaus.woodstox</groupId>
I faced the same issue in JDeveloper and that got resolved by adding "woodstox-core-asl-4.2.1.jar" to the classpath.
i was facing the same issue but deploying it to web sphere, and after a research of few hours figured out the exact version for woodstox, i.e. below
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.2.0</version>
</dependency>
This https://bugs.eclipse.org/bugs/show_bug.cgi?id=409070 link also helped to figured it out.
Both Java and .Net clients working fine.
I'm using EJB 3.0 with JBoss AS 7.1.1 Final. I am getting this error when I try to connect my client to the server:
Aug 15, 2012 12:05:00 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.5.Final
Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling
[appName:GrahamsProjServer,modulename:GrahamsProjServer,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvoc
ationContext#6a340101
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at $Proxy0.test(Unknown Source)
at grahamsprojclient.main.Start.testItAll(Unknown Source)
at grahamsprojclient.main.Start.main(Unknown Source)
Here is my standalone.xml: http://pastebin.com/BuvQ6f2H
Here is my jboss-ejb-client.properties: http://pastebin.com/mKpqZuZJ
Here is the code for my client: http://pastebin.com/wcVBZvKn
My classpath does contain jboss-ejb-client.properties. I made sure by looking in the manifest.
When I start up the client, with the server already running, the server prints this every time:
12:05:00,330 INFO [org.jboss.as.naming] (Remoting "h890bp1" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 2ea5a90b (inbound) of Remoting connection 11d4c3d5 to /127.0.0.1:51992
I have been working on this problem for several days and haven't found a solution. Any help would be greatly appreciated. If you need any other information from me than what I posted don't hesitate to ask and I'll post it immediately.
I found the solution! All I needed was to add this line to my client code: jndiProperties.put("jboss.naming.client.ejb.context", true);
I found it in a comment posted to this question: https://community.jboss.org/message/747360?_sscc=t
I'm having a strange issue.
I deploy my webapp to the server (jetty 7.4.3.v20110701), and everything (including mailer) seem to be working fine. Debugging info (got with -Djavax.activation.debug=true) for sending an email looks like this:
MailcapCommandMap: createDataContentHandler for text/html
search DB #0
got content-handler
class com.sun.mail.handlers.text_html
INFO [qtp1699297250-32] net.liftweb.util.TimeHelpers.info[195] - Service request (GET) /reservation/276 returned 200, took 264 Milliseconds
INFO [qtp1699297250-34] net.liftweb.util.TimeHelpers.info[195] - Service request (GET) /ajax_request/liftAjax.js returned 200, took 9 Milliseconds
MailcapCommandMap: createDataContentHandler for multipart/alternative
search DB #0
got content-handler
class com.sun.mail.handlers.multipart_mixed
But then suddenly, out of nowhere the code just stops working:
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception:
java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed
search DB #1
search DB #2
search DB #3
search fallback DB #0
search fallback DB #1
got content-handler
class com.sun.mail.handlers.multipart_mixed
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception: java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed
search fallback DB #2
got content-handler
class com.sun.mail.handlers.multipart_mixed
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception: java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed
search fallback DB #3
ERROR [pool-3-thread-13] net.liftweb.util.MailerImpl.error[239] - Couldn't send mail
javax.mail.MessagingException: IOException while sending message
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1141) ~[mail-1.4.4.jar:1.4.4]
at javax.mail.Transport.send0(Transport.java:189) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.Transport.send(Transport.java:118) ~[mail-1.4.1.jar:1.4.1]
at net.liftweb.util.MailerImpl$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:180) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:180) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$class.performTransportSend(Mailer.scala:174) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.Mailer$.performTransportSend(Mailer.scala:31) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$class.msgSendImpl(Mailer.scala:276) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.Mailer$.msgSendImpl(Mailer.scala:31) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:158) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:155) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$class.execTranslate(LiftActor.scala:321) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$MsgSender.execTranslate(Mailer.scala:154) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$proc2(LiftActor.scala:289) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$class.around(LiftActor.scala:224) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.util.MailerImpl$MsgSender.around(Mailer.scala:154) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:209) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$2$$anonfun$apply$mcV$sp$1.apply$mcV$sp(LiftActor.scala:173) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at net.liftweb.actor.LAScheduler$$anonfun$9$$anon$2$$anon$3.run(LiftActor.scala:64) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_24]
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/alternative;
boundary="----=_Part_8_877795714.1310372068000"
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:877) ~[na:1.6.0_24]
at javax.activation.DataHandler.writeTo(DataHandler.java:302) ~[na:1.6.0_24]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403) ~[mail-1.4.1.jar:1.4.1]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745) ~[mail-1.4.1.jar:1.4.1]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1099) ~[mail-1.4.4.jar:1.4.4]
... 23 common frames omitted
After some time it can start working again.
I've tried solutions, recommended here and here. I've also tried excluding javax.activation, using both javax.mail 1.4.1 and 1.4.4. Neither solution worked. What could be the cause? Any help appreciated.
I was able to fix it by making mail.jar and activation.jar provided in my pom.xml.
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
<scope>provided</scope>
</dependency>
The reason, I suppose, was that container already had mail.jar, and jdk 1.6 includes activation.jar.