apache-jdkim-0.2 2 is DKIM signing for multipart/* supposed to work?
Hi, I'm integrating an application (which uses Sendmail as MTA, and hybrid java/python mailing list manager) with apache jdkim. Other existing oss libraries (which I'd previously based the app on) seem to work fine for plain text, but multipart/alternative results in DKIM result: fail (wrong body hash) I see there are no junit tests for content type multipart DKIM only for it's predecessor DK. In org.apache.james.jdkim.impl.Message on line 79 ((SingleBody) message.getBody()).getInputStream(); However RFC 4871, say that no special processing is required for multipart, so this cast might be valid. I'm debugging and would like to affirm the premiss that pache-jdkim-0.2 for multipart/* content types is indeed considered functional? when run on a multipart produces the exception (I added a try/catch - throwable): java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) I spoke to someone on the mailing list he seems to believe it does work, hash a bug been fixed in a post-release build, or has this uncaught exception been slipping through the net? Thanks. - Justin
Re: apache-jdkim-0.2 2 is DKIM signing for multipart/* supposed to work?
2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com: [...] java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) This may happen if mime4j is not correctly instantiated/invoked. mime4j has to be instructed to do raw parsing (instead of the default multipart parsing). BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't use mime4j. Maybe there is a bug in the mime4j parsing part. Are you using mime4j-0.7 ? http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup MessageServiceFactory mbf = MessageServiceFactory.newInstance(); 70 mbf.setAttribute(MimeEntityConfig, mec); 71 mbf.setAttribute(FlatMode, true); 72 mbf.setAttribute(ContentDecoding, false); The FlatMode and ContentDecoding options are needed in order for mime4j to work. If they are not used or mime4j doesn't get it then you get a MultipartImpl object and jdkim doesn't work. Stefano - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: apache-jdkim-0.2 is DKIM signing for multipart/* supposed to work?
Hi Stefano, I was very happy to discover that you where signing millions of email's initially, now I'm just confused. This is an uncaught exception, so I was thinking maybe it was unnoticed or something. I'm using apache-mime4j-0.7.2, apache-jdkim-0.2 lists this as a dependancy in the maven pom.xml. DKIMSign.pl is written in perl, if this is what you are referring to. I am not a perl developer and can barely read perl. But I'm open to any solution at this stage, I did see there is a test class called org.apache.james.jdkim.PerlDKIMTest, how does perl relate to the apache-jdkim project? I've had a look at the causes for the ClassCastException, and it is not easy to fix, due to inheritance issues. These two classes have completely different abstract parent classes, they can only be referenced by org.apache.james.mime4j.dom.Message because their concrete children implement the interface. Are you suggesting I revert to apache-mime4j-0.7 rather then apache-mime4j-0.7.2? On Wed, Sep 25, 2013 at 9:06 AM, Stefano Bagnara apa...@bago.org wrote: 2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com: [...] java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) This may happen if mime4j is not correctly instantiated/invoked. mime4j has to be instructed to do raw parsing (instead of the default multipart parsing). BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't use mime4j. Maybe there is a bug in the mime4j parsing part. Are you using mime4j-0.7 ? http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup MessageServiceFactory mbf = MessageServiceFactory.newInstance(); 70 mbf.setAttribute(MimeEntityConfig, mec); 71 mbf.setAttribute(FlatMode, true); 72 mbf.setAttribute(ContentDecoding, false); The FlatMode and ContentDecoding options are needed in order for mime4j to work. If they are not used or mime4j doesn't get it then you get a MultipartImpl object and jdkim doesn't work. Stefano - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: apache-jdkim-0.2 is DKIM signing for multipart/* supposed to work?
Ok some progress I had extended org.apache.james.mime4j.message.DefaultMessageBuilder, to include fields and was not using org.apache.james.jdkim.impl.Message.newMessageBuilder(). I've changed this to use a decorator pattern, so the original code is now untouched. The classcastexception is no longer being thrown, but the org.apache.james.jdkim.impl.Message.getBodyInputStream() is still returning an empty InputStream, resulting in the wrong body hash. I had looked at Mailets. It seems a useful interface for integration with James server, however it complicates my integration. It is not clear to me how to integrate using Mailets, and I've not been able to find much documentation associated with such an objective. My extension application must integrate with Sendmail MTA, without using a transport socket, where Sendmail milter API is exposed else a standard install of opendkim would be fine. On Wed, Sep 25, 2013 at 9:29 AM, Justin Robinson dkim-proj...@fluidnotions.com wrote: Hi Stefano, I was very happy to discover that you where signing millions of email's initially, now I'm just confused. This is an uncaught exception, so I was thinking maybe it was unnoticed or something. I'm using apache-mime4j-0.7.2, apache-jdkim-0.2 lists this as a dependancy in the maven pom.xml. DKIMSign.pl is written in perl, if this is what you are referring to. I am not a perl developer and can barely read perl. But I'm open to any solution at this stage, I did see there is a test class called org.apache.james.jdkim.PerlDKIMTest, how does perl relate to the apache-jdkim project? I've had a look at the causes for the ClassCastException, and it is not easy to fix, due to inheritance issues. These two classes have completely different abstract parent classes, they can only be referenced by org.apache.james.mime4j.dom.Message because their concrete children implement the interface. Are you suggesting I revert to apache-mime4j-0.7 rather then apache-mime4j-0.7.2? On Wed, Sep 25, 2013 at 9:06 AM, Stefano Bagnara apa...@bago.org wrote: 2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com: [...] java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) This may happen if mime4j is not correctly instantiated/invoked. mime4j has to be instructed to do raw parsing (instead of the default multipart parsing). BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't use mime4j. Maybe there is a bug in the mime4j parsing part. Are you using mime4j-0.7 ? http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup MessageServiceFactory mbf = MessageServiceFactory.newInstance(); 70 mbf.setAttribute(MimeEntityConfig, mec); 71 mbf.setAttribute(FlatMode, true); 72 mbf.setAttribute(ContentDecoding, false); The FlatMode and ContentDecoding options are needed in order for mime4j to work. If they are not used or mime4j doesn't get it then you get a MultipartImpl object and jdkim doesn't work. Stefano - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526134 - /james/hupa/trunk/src/site/xdoc/index.xml
Author: manolo Date: Wed Sep 25 08:18:21 2013 New Revision: 1526134 URL: http://svn.apache.org/r1526134 Log: Fix hupa doc Modified: james/hupa/trunk/src/site/xdoc/index.xml Modified: james/hupa/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/src/site/xdoc/index.xml?rev=1526134r1=1526133r2=1526134view=diff == --- james/hupa/trunk/src/site/xdoc/index.xml (original) +++ james/hupa/trunk/src/site/xdoc/index.xml Wed Sep 25 08:18:21 2013 @@ -26,64 +26,20 @@ language used in the James project. And It has been a reference of a devloping using GWT good practices (MVP pattern and Unit testing) /p p Hupa is a functional and well designed email client, ready for - HEAD - HEAD - HEAD - HEAD reading, sending and managing messages, but it still lacks of many features email clients nowadays have./p -=== - reading, sending and managing messages, but it lacks of many features - email clients nowadays have like address book /p - first commit -=== - reading, sending and managing messages, but it still lacks of many features - email clients nowadays have./p - constantly changed by manolo -=== - reading, sending and managing messages, but it lacks of many features - email clients nowadays have like address book /p - first commit -=== - reading, sending and managing messages, but it still lacks of many features - email clients nowadays have./p - constantly changed by manolo /section section name=Releases p - HEAD - HEAD - HEAD - HEAD -=== - constantly changed by manolo -=== - constantly changed by manolo -Last release is Hupa 0.0.2:br/ -a href='http://repo1.maven.org/maven2/org/apache/james/hupa/hupa/0.0.2/hupa-0.0.2.war' binary /a : ready to run or to deploy in any servlet container.br/ -a href='http://repo1.maven.org/maven2/org/apache/james/hupa/hupa-parent/0.0.2/hupa-parent-0.0.2-source-release.zip' sources /a. +Last release is Hupa 0.0.3:br/ +a href='http://repo1.maven.org/maven2/org/apache/james/hupa/hupa/0.0.3/hupa-0.0.3.war' binary /a : ready to run or to deploy in any servlet container.br/ +a href='http://repo1.maven.org/maven2/org/apache/james/hupa/hupa-parent/0.0.3/hupa-parent-0.0.3-source-release.zip' sources /a. /p p Current trunk:br/ -a href='https://builds.apache.org/job/hupa-trunk/lastBuild/org.apache.james.hupa$hupa/artifact/org.apache.james.hupa/hupa/0.0.3-SNAPSHOT/hupa-0.0.3-SNAPSHOT.war' +a href='https://builds.apache.org/job/hupa-trunk/lastBuild/org.apache.james.hupa$hupa/artifact/org.apache.james.hupa/hupa/0.0.5-SNAPSHOT/hupa-0.0.5-SNAPSHOT.war' 0.3-SNAPSHOT - HEAD - HEAD -=== -Although there isn't a stable release yet you can download the latest -a href='https://builds.apache.org/job/hupa-trunk/lastBuild/org.apache.hupa$hupa/artifact/org.apache.hupa/hupa/0.0.2-SNAPSHOT/hupa-0.0.2-SNAPSHOT.war' - 0.2-SNAPSHOT - first commit -=== - constantly changed by manolo -=== -Although there isn't a stable release yet you can download the latest -a href='https://builds.apache.org/job/hupa-trunk/lastBuild/org.apache.hupa$hupa/artifact/org.apache.hupa/hupa/0.0.2-SNAPSHOT/hupa-0.0.2-SNAPSHOT.war' - 0.2-SNAPSHOT - first commit -=== - constantly changed by manolo /a from our continuous integration server. /p @@ -99,55 +55,15 @@ section name=News subsection name=2012 - HEAD - HEAD - HEAD - HEAD -=== - constantly changed by manolo -=== - constantly changed by manolo h4Jun/2012 - Hupa 0.2 released/h4 p First stable version. /p - HEAD - HEAD -h4Apr/2012 - Hupa evolution accepted/h4 -p -We have got a a href=http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/echo/1; -target=_blankGSOC student/a who will work with Hupa this Summer -making it better !. -=== -=== - constantly changed by manolo -h4Apr/2012 - Hupa evolution accepted/h4 -p - HEAD -Whe have got a GSOC student who will work with Hupa this Summer -a
svn commit: r1526135 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/ client/src/main/java/org/apache/hupa/client/activity/ client/src/main/java/org/apache/hupa/client/gin/ client/
Author: manolo Date: Wed Sep 25 08:19:23 2013 New Revision: 1526135 URL: http://svn.apache.org/r1526135 Log: Remove unused source files Removed: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageSendActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/TopActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MessageSendPlace.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/IMAPFolderProxy.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/AppLayout.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/AppLayoutImpl.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/AppLayoutImpl.ui.xml james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/Displayable.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageSendView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageTableModel.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SettingEcsPanel.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SettingEcsPanel.ui.xml james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SettingLabelPanel.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SettingLabelPanel.ui.xml james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/WestView.java james/hupa/trunk/server/src/main/java/com/chiaramail/hupa/helper/Account.java james/hupa/trunk/server/src/main/java/com/chiaramail/hupa/helper/Utility.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractDeleteMessageHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractSendMessageHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/DeleteFolderHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/DeleteMessageByUidHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchFoldersHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/FetchMessagesHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/GetMessageDetailsHandler.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/SetFlagsHandler.java james/hupa/trunk/server/src/test/java/com/chiaramail/hupa/helper/EcsUtilityTest.java james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/AbtractSendMessageHandlerTest.java james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ContactsHandlerTest.java james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/FetchMessagesHandlerTest.java james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/HandlersTest.java
Jenkins build is back to normal : hupa-trunk ยป Apache James Hupa Shared #351
See https://builds.apache.org/job/hupa-trunk/org.apache.james.hupa$hupa-shared/351/changes - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Jenkins build is back to normal : hupa-trunk #351
See https://builds.apache.org/job/hupa-trunk/351/changes - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Build failed in Jenkins: james-server-trunk #4046
See https://builds.apache.org/job/james-server-trunk/4046/ -- [...truncated 629 lines...] at org.apache.felix.obrplugin.ObrInstall.execute(ObrInstall.java:141) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at hudson.maven.Maven3Builder.call(Maven3Builder.java:130) at hudson.maven.Maven3Builder.call(Maven3Builder.java:67) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679) Caused by: org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@3:1 in java.io.InputStreamReader@136d6735) at org.kxml2.io.KXmlParser.exception(Unknown Source) at org.kxml2.io.KXmlParser.nextTag(Unknown Source) at org.apache.felix.bundlerepository.impl.PullParser.parseRepository(PullParser.java:43) at org.apache.felix.bundlerepository.impl.DataModelHelperImpl.repository(DataModelHelperImpl.java:147) at org.apache.felix.bundlerepository.impl.DataModelHelperImpl.repository(DataModelHelperImpl.java:118) at org.apache.felix.obrplugin.ObrUpdate.parseRepositoryXml(ObrUpdate.java:316) ... 34 more Sep 25, 2013 10:09:19 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: Sep 25, 2013 10:09:19 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: --- maven-remote-resources-plugin:1.4:process (default) @ james-server-lifecycle-api --- Sep 25, 2013 10:09:19 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: Sep 25, 2013 10:09:19 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: --- maven-resources-plugin:2.6:resources (default-resources) @ james-server-lifecycle-api --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/src/main/resources [INFO] Copying 3 resources [INFO] Copying 3 resources Sep 25, 2013 10:09:20 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: Sep 25, 2013 10:09:20 AM org.apache.maven.cli.event.ExecutionEventLogger mojoStarted INFO: --- maven-compiler-plugin:3.0:compile (default-compile) @ james-server-lifecycle-api --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 4 source files to https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/target/classes Sep 25, 2013 10:09:20 AM
apache-jdkim-0.2 dependance apache-mime4j-0.7.2 org.apache.james.mime4j.dom.ServiceLoader.load(ClassT) does not load class instances
I've discovered the root to all my problems is that org.apache.james.mime4j.dom.ServiceLoader.load(ClassT) seems unable to load the correct instance type for the given interface eg: spiResURI: META-INF/services/org.apache.james.mime4j.dom.MessageServiceFactory resource: .../META-INF/services/org.apache.james.mime4j.dom.MessageServiceFactory [image: Inline image 1] Am not sure how this is supposed to work, the the supposed instance types seem to be null leading to strange behaviour, I'm using java jdk 6.0. On Wed, Sep 25, 2013 at 9:06 AM, Stefano Bagnara apa...@bago.org wrote: 2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com: [...] java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) This may happen if mime4j is not correctly instantiated/invoked. mime4j has to be instructed to do raw parsing (instead of the default multipart parsing). BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't use mime4j. Maybe there is a bug in the mime4j parsing part. Are you using mime4j-0.7 ? http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup MessageServiceFactory mbf = MessageServiceFactory.newInstance(); 70 mbf.setAttribute(MimeEntityConfig, mec); 71 mbf.setAttribute(FlatMode, true); 72 mbf.setAttribute(ContentDecoding, false); The FlatMode and ContentDecoding options are needed in order for mime4j to work. If they are not used or mime4j doesn't get it then you get a MultipartImpl object and jdkim doesn't work. Stefano - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
Re: apache-jdkim-0.2 dependance apache-mime4j-0.7.2 org.apache.james.mime4j.dom.ServiceLoader.load(ClassT) does not load class instances
2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com I've discovered the root to all my problems is that org.apache.james.mime4j.dom.ServiceLoader.load(ClassT) seems unable to load the correct instance type for the given interface eg: spiResURI: META-INF/services/org.apache.james.mime4j.dom.MessageServiceFactory resource: .../META-INF/services/org.apache.james.mime4j.dom.MessageServiceFactory MessageServiceFactory is an abstract class so it is not the class returned. If you don't get an exception then it must be loading the class declared in META-INF\services\org.apache.james.mime4j.dom.MessageServiceFactory that is org.apache.james.mime4j.message.MessageServiceFactoryImpl BTW, can you provide a failing test case for your scenario? If not, then maybe you have something weird in your classpath (e.g: multiple mime4j versions). Stefano PS: I don't know what Inline image 1 is from your message (the mailing list removed it). [image: Inline image 1] Am not sure how this is supposed to work, the the supposed instance types seem to be null leading to strange behaviour, I'm using java jdk 6.0. On Wed, Sep 25, 2013 at 9:06 AM, Stefano Bagnara apa...@bago.org wrote: 2013/9/25 Justin Robinson dkim-proj...@fluidnotions.com: [...] java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl cannot be cast to org.apache.james.mime4j.dom.SingleBody at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80) at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85) This may happen if mime4j is not correctly instantiated/invoked. mime4j has to be instructed to do raw parsing (instead of the default multipart parsing). BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't use mime4j. Maybe there is a bug in the mime4j parsing part. Are you using mime4j-0.7 ? http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup MessageServiceFactory mbf = MessageServiceFactory.newInstance(); 70 mbf.setAttribute(MimeEntityConfig, mec); 71 mbf.setAttribute(FlatMode, true); 72 mbf.setAttribute(ContentDecoding, false); The FlatMode and ContentDecoding options are needed in order for mime4j to work. If they are not used or mime4j doesn't get it then you get a MultipartImpl object and jdkim doesn't work. Stefano - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526347 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: gin/ mvp/
Author: dongxu Date: Thu Sep 26 02:00:47 2013 New Revision: 1526347 URL: http://svn.apache.org/r1526347 Log: remove useless folders Removed: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526349 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: activity/ evo/ mapper/
Author: dongxu Date: Thu Sep 26 02:07:11 2013 New Revision: 1526349 URL: http://svn.apache.org/r1526349 Log: remove useless files Removed: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelPropertiesActivity.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/evo/ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/ActivityManagerInitializer.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/AppPlaceHistoryMapper.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/CachingTopActivityMapper.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/CachingWestActivityMapper.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/ComposeActivityMapper.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/TopActivityMapper.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mapper/WestActivityMapper.java~HEAD - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526350 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: place/ rf/ ui/
Author: dongxu Date: Thu Sep 26 02:10:21 2013 New Revision: 1526350 URL: http://svn.apache.org/r1526350 Log: remove useless files Removed: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/FolderPlace.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailFolderPlace.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/rf/ImapFolderRequest.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ComposeView.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.ui.xml~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/WidgetContainerDisplayable.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/WidgetDisplayable.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/_ToolPanel.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/_ToolPanel.ui.xml~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/__ContentPanel.java~HEAD james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/__ContentPanel.ui.xml~HEAD - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526352 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: activity/SearchBoxActivity.java ui/NavigationView.java ui/SearchBoxView.java
Author: dongxu Date: Thu Sep 26 02:15:46 2013 New Revision: 1526352 URL: http://svn.apache.org/r1526352 Log: remove some warnings in client package Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NavigationView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java?rev=1526352r1=1526351r2=1526352view=diff == --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java Thu Sep 26 02:15:46 2013 @@ -22,8 +22,6 @@ package org.apache.hupa.client.activity; import java.util.List; import org.apache.hupa.shared.domain.Message; -import org.apache.hupa.shared.events.MessagesReceivedEvent; -import org.apache.hupa.shared.events.MessagesReceivedEventHandler; import org.apache.hupa.shared.events.RefreshMessagesEvent; import com.google.gwt.event.dom.client.ClickEvent; Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NavigationView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NavigationView.java?rev=1526352r1=1526351r2=1526352view=diff == --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NavigationView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NavigationView.java Thu Sep 26 02:15:46 2013 @@ -20,7 +20,6 @@ package org.apache.hupa.client.ui; import org.apache.hupa.client.activity.NavigationActivity; -import org.apache.hupa.client.place.ContactPlace; import org.apache.hupa.client.place.FolderPlace; import org.apache.hupa.client.place.SettingPlace; Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java?rev=1526352r1=1526351r2=1526352view=diff == --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java Thu Sep 26 02:15:46 2013 @@ -29,8 +29,6 @@ import com.google.gwt.event.dom.client.H import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Button; @@ -38,7 +36,6 @@ import com.google.gwt.user.client.ui.Com import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.MultiWordSuggestOracle; -import com.google.gwt.user.client.ui.SuggestBox; import com.google.gwt.user.client.ui.TextBox; public class SearchBoxView extends Composite implements SearchBoxActivity.Displayable { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526378 - in /james/hupa/trunk: client/src/main/java/com/google/gwt/ server/src/main/java/com/chiaramail/ server/src/main/java/org/apache/hupa/server/domain/ server/src/main/java/org/apac
Author: dongxu Date: Thu Sep 26 04:30:19 2013 New Revision: 1526378 URL: http://svn.apache.org/r1526378 Log: remove useless folders Removed: james/hupa/trunk/client/src/main/java/com/google/gwt/ james/hupa/trunk/server/src/main/java/com/chiaramail/ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/domain/ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/demo/ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/locator/ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/rf/ james/hupa/trunk/server/src/test/java/com/ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/handler/ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/mock/ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/preferences/ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/servlet/ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/locator/ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/proxy/ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/rf/ - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526381 - /james/hupa/trunk/src/site/xdoc/index.xml
Author: dongxu Date: Thu Sep 26 04:31:23 2013 New Revision: 1526381 URL: http://svn.apache.org/r1526381 Log: remove the broken link of hupa Modified: james/hupa/trunk/src/site/xdoc/index.xml Modified: james/hupa/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/src/site/xdoc/index.xml?rev=1526381r1=1526380r2=1526381view=diff == --- james/hupa/trunk/src/site/xdoc/index.xml (original) +++ james/hupa/trunk/src/site/xdoc/index.xml Thu Sep 26 04:31:23 2013 @@ -46,7 +46,7 @@ /section section name=Demo -p There are a href='http://james.zones.apache.org/index.html'two/a instances of Hupa running in the ASF infra. One is +p There are two instances of Hupa running in the ASF infra. One is configured to use GMail IMAP and SMTP servers, so any gmail account should work. The other one uses a set of messages used to test Hupa with fake imap and smtp servers implementations. - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r1526383 - /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README
Author: dongxu Date: Thu Sep 26 04:36:38 2013 New Revision: 1526383 URL: http://svn.apache.org/r1526383 Log: add theme's license note Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README?rev=1526383view=auto == --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README (added) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/README Thu Sep 26 04:36:38 2013 @@ -0,0 +1 @@ +Lots of theme resources in this package are borrowed from http://roundcube.net \ No newline at end of file - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org