[jBPM Development] - AttachmentTest failure
by Huisheng Xu
Huisheng Xu [http://community.jboss.org/people/rebody] created the discussion
"AttachmentTest failure"
To view the discussion, visit: http://community.jboss.org/message/538887#538887
--------------------------------------------------------------
Hi Alejandro,
I had updated current trunk. The org.jbpm.test.activity.mail.AttachmentTest failed. The test case reported as below:
### EXCEPTION ###########################################
13:20:12,799 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd@1613b53
org.jbpm.api.JbpmException: could not send email: javax.mail.internet.MimeMessage@1aa0a15
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:60)
at org.jbpm.jpdl.internal.activity.MailActivity.perform(MailActivity.java:46)
at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:657)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:617)
at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:218)
at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:65)
at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)
at org.jbpm.test.activity.mail.AttachmentTest.testVariableAttachment(AttachmentTest.java:84)
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 junit.framework.TestCase.runTest(TestCase.java:164)
at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:87)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type image/gif
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
at org.jbpm.pvm.internal.email.impl.MailSessionImpl.send(MailSessionImpl.java:51)
... 43 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type image/gif
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896)
at javax.activation.DataHandler.writeTo(DataHandler.java:317)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:874)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:444)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:102)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:894)
at javax.activation.DataHandler.writeTo(DataHandler.java:317)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
... 44 more
The activation cannot find DataContentHandler(DCH) for Mime-Type image/gif. jBPM 4 are using activition-1.1.jar to provider javamail attach. When I change it to activation-1.1.1.jar, the attachmenttest could pass successfully.
I digg deeper and find out that activition-1.1.1.jar decide the dataContent's type, when the class of data content is byte[], it will write it to the content directly.
I saw there is a mailcap file in the mail-1.4.1.jar at META/mailcap. Here is the content.
#
# @(#)mailcap 1.8 05/04/20
#
# Default mailcap file for the JavaMail System.
#
# JavaMail content-handlers:
#
text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain
text/html;; x-java-content-handler=com.sun.mail.handlers.text_html
text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml
multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822
#
# can't support image types because java.awt.Toolkit doesn't work on servers
#
#image/gif;; x-java-content-handler=com.sun.mail.handlers.image_gif
#image/jpeg;; x-java-content-handler=com.sun.mail.handlers.image_jpeg
As we can see, the image/gif and image/jpeg parts have been commented, so they won't be effect.
At the last, how could we solve this exception? Could we update activation-1.1.jar to activation-1.1.1.jar? Or we should do some other things to prevent the exception?
Any reply will be appreciate. Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/538887#538887]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [jBPM] - About differences between jPDL editors jBPM 3.2.6 and 4.3
by Huisheng Xu
Huisheng Xu [http://community.jboss.org/people/rebody] replied to the discussion
"About differences between jPDL editors jBPM 3.2.6 and 4.3"
To view the discussion, visit: http://community.jboss.org/message/538878#538878
--------------------------------------------------------------
Hi Manuel,
At this moment, the GPD for jBPM 4 is quite simple, and there are many features cannot be used on it, e.g. the properties of activity had not been supported completely, and there are still some issues didn't be fixed yet, e.g. if you enter the name of activity in property panel, the text will be turn to reverse. And some issues are depended by the PVM implementation, e.g. PVM had not supported variable declaration, so we could define process varaibles in GPD yet. So if you want to use GPD to design process definition on jBPM 4 there are still something having to edit source xml by hand.
You can see the roadmap from JIRA. https://jira.jboss.org/jira/browse/JBPM https://jira.jboss.org/jira/browse/JBPM Because there are many issues that have not been fixed, so I said jBPM 4 doesnot complete.
At this moment, we are using jBPM 4.3. And of course we make some extension on jBPM 4 for our requirements.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/538878#538878]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JBoss Web Services Metro] - Problem with @XmlJavaTypeAdapter
by Umit Gezer
Umit Gezer [http://community.jboss.org/people/haza] created the discussion
"Problem with @XmlJavaTypeAdapter"
To view the discussion, visit: http://community.jboss.org/message/538876#538876
--------------------------------------------------------------
Hi All,
I'm coding a set of web services and having some problems when using @XmlJavaTypeAdapter.
Here is the exception I get when I try to deploy to JBoss 5.1 and jbossmetro 3.2.2.
{quote}
09:09:30,571 INFO [server] Dynamically creating request wrapper Class au.com.finsyn.acuritywebservices.services.member.jaxws.GetMemberDetails
09:09:30,571 INFO [server] Dynamically creating response wrapper bean Class au.com.finsyn.acuritywebservices.services.member.jaxws.GetMemberDetailsResponse
09:09:30,602 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/AcurityWebServices.war/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/AcurityWebServices.war/
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: Failed to build METRO runtime model
at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:134)
at org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer.internalDeploy(WSDeploymentAspectDeployer.java:107)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
... 24 more
Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: value class au.com.finsyn.acuritywebservices.utils.MapAdapter
at com.sun.xml.ws.model.WrapperBeanGenerator.createResponseWrapperBean(WrapperBeanGenerator.java:280)
at com.sun.xml.ws.model.RuntimeModeler.getResponseWrapperClass(RuntimeModeler.java:304)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:699)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:623)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:412)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:251)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:323)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:189)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parseAdapters(DeploymentDescriptorParserExt.java:295)
at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parse(DeploymentDescriptorParserExt.java:171)
at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:110)
... 27 more
Caused by: java.lang.IllegalArgumentException: value class au.com.finsyn.acuritywebservices.utils.MapAdapter
at com.sun.xml.ws.org.objectweb.asm.ClassWriter.newConstItem(ClassWriter.java:893)
at com.sun.xml.ws.org.objectweb.asm.AnnotationWriter.visit(AnnotationWriter.java:185)
at com.sun.xml.ws.model.WrapperBeanGenerator.createBeanImage(WrapperBeanGenerator.java:122)
at com.sun.xml.ws.model.WrapperBeanGenerator.createResponseWrapperBean(WrapperBeanGenerator.java:276)
... 38 more
09:09:30,946 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** DEPLOYMENTS IN ERROR: Name -> Error
vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/AcurityWebServices.war/ -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/AcurityWebServices.war/
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/AcurityWebServices.war/" is in error due to the following reason(s): java.lang.IllegalArgumentException: value class au.com.finsyn.acuritywebservices.utils.MapAdapter
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
{quote}
And below are some code snippets:
{code}
@WebService()
public class Member
{
@WebMethod(operationName = "getMemberDetails")
@XmlJavaTypeAdapter(MapAdapter.class)
public Map<String, String> getMemberDetails(@WebParam(name = "fundCode") String MDz_Fund,
@WebParam(name = "memberCode") String MDz_Member)
throws AcurityWebServiceException
{
...
}
}
public class MapAdapter extends XmlAdapter<MapElement[], Map<String, String>>
{
@Override
public MapElement[] marshal(Map<String, String> map) throws Exception
{
MapElement[] mapElements = new MapElement[map.size()];
int i = 0;
for (Map.Entry<String, String> entry : map.entrySet())
{
mapElements[i++] = new MapElement(entry.getKey(), entry.getValue());
}
return mapElements;
}
@Override
public Map<String, String> unmarshal(MapElement[] elementsList) throws Exception
{
Map<String, String> map = new HashMap<String, String>();
for (MapElement mapelement : elementsList)
{
map.put(mapelement.key, mapelement.value);
}
return map;
}
public static class MapElement
{
@XmlElement
public String key;
@XmlElement
public String value;
private MapElement()
{
} //Required by JAXB
public MapElement(String key, String value)
{
this.key = key;
this.value = value;
}
}
}
{code}
So, what am I doing wrong? The above code works fine in glassfish. But not JBoss.
Can anyone help?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/538876#538876]
Start a new discussion in JBoss Web Services Metro at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years