Announcement Announcement Module
Collapse
No announcement yet.
problem with javax.mail packages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Andy,

    I'm currently running on DM Server 1.0.1.RELEASE, with JRE 1.6.0 u07 (yes, I know there are later versions of both available, but that's where I started and haven't needed to change - yet!).

    Cheers,
    Skippy

    Comment


    • #17
      Hi Skippy,

      Thanks for the information.

      I've spent a bit of time looking at this, and have discovered that we've made a mistake with the version of javax.activation that we package, and that we export from the system bundle. I had thought that it was version 1.1.0 that's part of SE 6 but, have learned that it's 1.1.1. I've opened DMS-919 to fix this.

      You may like to try the likely fix - it's pretty straightforward, especially as you're on Java 6. All you need to do is update the java6-server.profile file to export javax.activation at version 1.1.1, rather than version 1.1.0.

      Here's the diff for the profile:

      Code:
      - javax.activation;version="1.1.0",\
      + javax.activation;version="1.1.1",\
      For completeness, if anyone wishes to try this on Java 5, you would have to make the same change to the java5-server.profile and replace the javax.activation 1.1.0 bundle in the lib directory with javax.activation 1.1.1.

      I'm hopeful that this change will fix your problem, and allow you to make use of javax mail 1.4.1. It'd be great if you could try it out, and let me know how you get on.

      Thanks,
      Andy

      Comment


      • #18
        Hi Andy,

        Many thanks for looking into this.

        I'd love to say that it worked for me, but it doesn't appear to have done so - perhaps because I'm still using DM Server 1.0.1? Anyway, here's what I did and the results it gave:

        I edited the java6-server.profile file (in %SERVER_HOME%/lib) as per your instructions, downloaded javax.mail v1.4.1 and updated my manifest to import bundle javax.mail 1.4.1. I completely rebuilt my app, restarted the server and redeployed the app. When I tried sending mail I got the "No object DCH for MIME type text/html" exception.

        I noted when editing the profile file that the activation version in the same directory was at 1.1.0. I tried replacing it with 1.1.1 (having downloaded it from the S2BR) and now the server won't start, complaining that the "activation-1.1.0.jar which is referenced by the classpath, does not exist". Does this mean I should have restarted Eclipse too?

        Cheers,
        Skippy

        Comment


        • #19
          Sorry to hear that didn't solve your problem and thanks for trying out the change. I think we're making progress, as everything now resolves using activation 1.1.1.

          As for your two problems, let's take the easy one first

          Originally posted by Skippy View Post
          I noted when editing the profile file that the activation version in the same directory was at 1.1.0. I tried replacing it with 1.1.1 (having downloaded it from the S2BR) and now the server won't start, complaining that the "activation-1.1.0.jar which is referenced by the classpath, does not exist". Does this mean I should have restarted Eclipse too?
          The run configuration that's created by dm Server tools includes references to all of the JARs in the lib directory. You should be able to fix this, either by modifiying the configuration, or by deleting your existing targetted runtime, and recreating it.

          I edited the java6-server.profile file (in %SERVER_HOME%/lib) as per your instructions, downloaded javax.mail v1.4.1 and updated my manifest to import bundle javax.mail 1.4.1. I completely rebuilt my app, restarted the server and redeployed the app. When I tried sending mail I got the "No object DCH for MIME type text/html" exception.
          This one's a little harder. I think I'll need to spend some time trying to reproduce this so that I can debug javax.mail's behaviour. If you would be happy to attach your application that reproduces the problem then that would be a big help.

          Thanks again,
          Andy

          Comment


          • #20
            Well, yes...
            The run configuration that's created by dm Server tools includes references to all of the JARs in the lib directory. You should be able to fix this, either by modifiying the configuration, or by deleting your existing targetted runtime, and recreating it.
            Run configurations - I'd just got there!

            The "No object DCH..." exception is a real so and so and seems to be being caused by activation not being able to see the mail bundle referenced by my bundle. bjansen's horrible hack is the only way I seem to be able to circumvent it. This despite Oleg's analysis that importing the mail bundle - rather that the individual pacakges - should resolve it.

            Unfortunately, NDA's prevent me from attaching the app per-se, but I've PM'ed you with some details.

            Cheers,
            Skippy

            Comment


            • #21
              Hi Skippy,

              I've done some experimenting with the application that you sent me, and, at long last, I think I may have cracked it.

              I managed to reproduce the problem on my Mac development box using Java 6 (1.6.0_07). I then tried it on my Mac using Java 5, and could not reproduce the problem. Crucially, in the Java 5 case, the JVM would be using the javax.activation API and implementation from the 1.1.1 javax activation bundle, whereas on Java 6, it would be using them from the JRE (anything that's part of the JRE takes precedence over what's in dm Server's lib directory). I then tried the app on an Ubuntu box, this time using Java 6 1.6.0_10. I could not reproduce the problem.

              It would appear that a fix has been made to the Activation implementation somewhere between the 0_07 and 0_10 releases of Java 6. This tallys with Kryptolus's experience where updating the version of JDK 6 fixed the problem.

              Is upgrading the version of SE 6 that you're using an option for you?

              Comment


              • #22
                Well Andy, thank you ever so much for investigating this for me (and anyone else coming across the same problem). Fortunately, I am able to use a newer JVM and can confirm that, having upgraded to JRE 1.6.0 u11 - I had a copy kicking around already - the mail bundle now works like a dream, even without the "horrible hack"!

                Many thanks once again.

                Cheers,
                Skippy

                Comment


                • #23
                  Great stuff! Glad to hear you got it working, and that the horrible hack is no more

                  Comment


                  • #24
                    I've just had this same problem "No object DCH for MIME type" but on Ubuntu java version "1.6.0_13". So I don't know how you guys solved it by upgrading to 1.6.0_11.
                    What I did is copy the mailcab.default to my own bundle and it worked. Seems to be a classloading problem which I don't fully understand yet.

                    Comment

                    Working...
                    X