Author |
Message
|
angka |
Posted: Thu Nov 18, 2010 2:39 am Post subject: Support pac IA9R |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Anyone get this support pac working with pure text attachment? I got java.lang.classCastException: javax.mail.util.SharedByteArrayInputStream incompatible with javax.mail.Multipart in the POP3MailHelper.java class. the statement tt causes the exception is part = ((Multipart)message.getBodyPart(0);
anyone got a solution? thanks. |
|
Back to top |
|
 |
angka |
Posted: Thu Nov 18, 2010 5:17 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Below is the email i retrieve:
Received: from [192.168.133.128] by win2003ee
(ArGoSoft Mail Server Freeware, Version 1.8 (1.8.8. ); Thu, 18 Nov 2010 21:07:12
From: <Apple>
To: <Orange>
Subject: Test subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="57748801"
Message-ID: <32oa47cqkzj6ex4.181120102107@win2003ee>
Date: Thu, 18 Nov 2010 21:07:12
This is a multipart message in MIME format
--57748801
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Test message body
--57748801
Content-Type: text/plain; name="TestAttachement.txt"
Content-Transfer-Encoding: Quoted-Printable
Content-Disposition: attachment; filename="TestAttachement.txt"
no data in the attachment?
-
--57748801--
Is there anything not right with the format of the email? somehow when i try to cast the message to Multipart, it failed. There is attachment to the message but why did it fail? anyone can help?? thanks |
|
Back to top |
|
 |
jonasb |
Posted: Thu Nov 18, 2010 5:32 am Post subject: classpath |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
Hi,
I assume you are using Message Broker version 7?
We have the same issue on our upgraded servers.
(It works fine on version 6.1 servers)
I have noticed that the classes used aren't the ones from the activation.jar but from the system library jar rt.jar. (package=javax.activation).
My question is: Is there a prefered way to make sure that the activation.jar classes are used? You only wants this for this flow. _________________ contact admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 18, 2010 7:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So at least in v7.0.0.1, you can take some additional customization steps on this supportPac that will provide some relieve.
If I recall correctly, this supportPac is currently shipped as a subflow that contains two JavaCompute nodes. You can create a JavaClassLoader Configurable Service that specifies a directory for the IA9R jar files, and specify that the two JavaCompute nodes in the subflow should use this classloader.
But you should contact the author of this SupportPac directly for support. |
|
Back to top |
|
 |
jonasb |
Posted: Thu Nov 18, 2010 8:21 am Post subject: Hi, |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
The code works fine in a stand alone java application.
The problem is with system library jars having the same classes and the classloading sequence in Broker 7.
I have tried to create a configurable service like this:
Code: |
mqsicreateconfigurableservice FTFXPUTV_BRK -c JavaClassLoader -o pop3ClassLoader -n includedDeployedJars -v "activation.jar;mail.jar"
|
And add "pop3ClassLoader" to the java node config.
When I deploy, I get the following error:
Code: |
Message: BIP4500E
Source: Runtime Response
Creation time: Thu Nov 18 16:38:06 CET 2010
BIP4500E: Failed to deploy Java code resource 'JAR'. The Java stack trace is: 'Frame : 0 java.lang.NoClassDefFoundError: javax.mail.Part
@: java.lang.J9VMInternals.verifyImpl(Na... (data of len 2622 truncated)'
The Java JAR file deployment to the broker failed.
This is an internal error. Contact your IBM support center.
|
And of course, the javax.mail.Part is in the jars specified.
I made a final attempt to change the JavaClassLoader service:
Code: |
mqsichangeproperties FTFXPUTV_BRK -c JavaClassLoader -o pop3ClassLoader -n sharedJarPath -v c:/tmp/pop3classes
|
..and copy the jars to that directory instead, but that also failed.
I know this is not supported by IBM, but has anyone been able to get multipart emails to parse as MimeMultipart objects, please let me know.
Also, if any kind soul out there could come up with an (general)explanation to how the classloading works (to help me understand how to avoid the error displayed above) it would be greatly appreciated.
Kind Regards,
contact admin _________________ contact admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Nov 18, 2010 8:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
angka |
Posted: Thu Nov 18, 2010 8:44 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Ya I am on WMB 7. Still can't get it working. Think I ll need thread up. Thanx. |
|
Back to top |
|
 |
angka |
Posted: Fri Nov 19, 2010 1:36 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I still can't get it working.
Quote from http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac37125_.htm
Quote: |
When you include one or more JavaCompute nodes in a broker archive (BAR) file, the JAR files are loaded in a separate classloader. The classloader loads all classes that are packaged in the deployed BAR file. These classes override any classes that are in the shared classes directory or the CLASSPATH environment variable. |
Doesn't it mean tt if the .jar file is in the deployed BAR file, it should be using that instead?
Anyway I tried using configurableservice, it still does not work.
I created:
Code: |
mqsicreateconfigurableservice TESTQMBROKER -c JavaClassLoader -o pop3ClassLoader -n includedDeployedJars -v "d:\workspace\IA9RJava\activation.jar;d:\workspace\IA9RJava\mail.jar"
|
and add it to the java compute node java classloader service property.
the error i got when deploying is:
java.lang.classNotFoundException.
Any help appreciated. thanks |
|
Back to top |
|
 |
jonasb |
Posted: Fri Nov 19, 2010 2:05 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
Hi mqjeff! (and others) :-)
Config1:
Code: |
mqsireportproperties FTFXPUTV_BRK -c JavaClassLoader -o AllReportableEntityNames -r
JavaClassLoader
Template
includedDeployedJars='automatic'
sharedJarPath=''
pop3ClassLoader
includedDeployedJars='activation.jar;mail.jar'
sharedJarPath='' |
In this configuration I made three tests:
1) activation.jar and mail.jar in bar file
2) activation.jar and mail.jar predeployed to the exec group
3) activation.jar and mail.jar predeployed *and* in bar file
Config2:
Code: |
mqsireportproperties FTFXPUTV_BRK -c JavaClassLoader -o AllReportableEntityNames -r
JavaClassLoader
Template
includedDeployedJars='automatic'
sharedJarPath=''
pop3ClassLoader
includedDeployedJars='activation.jar;mail.jar'
sharedJarPath='c:/tmp/pop3classes' |
In this configuration I made one test: bars only in the shared jar path
Config3 (as suggested by mqjeff):
Code: |
mqsireportproperties FTFXPUTV_BRK -c JavaClassLoader -o AllReportableEntityNames -r
JavaClassLoader
Template
includedDeployedJars='automatic'
sharedJarPath=''
pop3ClassLoader
includedDeployedJars='automatic'
sharedJarPath='c:/tmp/pop3classes' |
in this configuration I also only made one test, with jar fies in shared jar path only.
All fails with this error:
Code: |
BIP4500E: Failed to deploy Java code resource 'JAR'. The Java stack trace is: 'Frame : 0 java.lang.NoClassDefFoundError: javax.mail.Part
@: java.lang.J9VMInternals.verifyImpl(Na... (data of len 2242 truncated)'
The Java JAR file deployment to the broker failed.
This is an internal error. Contact your IBM support center.
|
(and yes, i have tried both forward and backward slashes in the path)
To make sure I understood the functionality, I finally made som simple HelloWorld tests to verify that classes could be loaded from a sharedJarPath, and they worked fine. _________________ contact admin |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 19, 2010 3:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'll see if I can experiment further. |
|
Back to top |
|
 |
angka |
Posted: Fri Nov 19, 2010 10:12 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I got it working. All thanks to the author of the code, Wang Chao.
Quote: |
It's a known issue. The JAF jar files are included in WMB7's new JRE 1.6.x(http://www.roseindia.net/javamail/Introduction-to-Java-Mail-API.shtml). Therefore the JAF and JavaMail jar files are in different class loader. Placing both mail.jar and activation.jar to the jre/lib/ext directory should be able to resolve the issue. Let me know if the problem persists. |
just put both the .jar file in the MQSI \7.0\jre16\lib\ext folder.
Thanks all for the help. =)
Cheers. |
|
Back to top |
|
 |
jonasb |
Posted: Mon Nov 22, 2010 1:04 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2006 Posts: 49 Location: Sweden
|
I can only confirm, it works like a charm! _________________ contact admin |
|
Back to top |
|
 |
sunny7413 |
Posted: Thu Oct 10, 2013 9:25 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2013 Posts: 29
|
I am getting this same issue and i resolved on my windows machine by placing the two jars(mail jar and activation jar)in broker installation path and works well.what my problem is with aix server do the above process works well there also or there is any other solution for it? |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Oct 10, 2013 9:51 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Please don't reopen three year old threads like this. It is better to start a new one and reference the old one.
Please let us know what version of Broker (x.x.x.x format) you are developing for. In later versions there are builtin nodes that make this support pack redundant.
The Support Pack has not been updated since 2008 and was developed for Broker V6, V6.1 both of which are out of support now.
The 'fix' for V7 was a hack and not one I'd ever consider putting into production. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
sunny7413 |
Posted: Thu Oct 10, 2013 10:18 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2013 Posts: 29
|
Sorry dont know about referencing,I will follow it from next topic.Aix os version 7.1, mb version 7.0.0.4. |
|
Back to top |
|
 |
|