Abdera
  1. Abdera
  2. ABDERA-297

UnsupportedOperationException while initializing MimeTypeHelper

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Environment:

      Description

      The Geronimo Activation 1.1 spec implementation of the javax.activation.MimeType tries to call the method setPrimaryType during the construction of the MimeType. This results in a call to MimeTypeHelper$UnmodifiableMimeType.setPrimaryType which then results in a UnsupportedOperationException.

      See error message below:

      Feb 28, 2012 12:25:05 AM org.apache.abdera2.common.protocol.TransactionalRequestProcessor apply
      SEVERE: java.lang.ExceptionInInitializerError
      Feb 28, 2012 12:25:05 AM org.apache.abdera2.common.protocol.ProviderHelper servererror
      INFO: null
      Throwable occurred: java.lang.ExceptionInInitializerError
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
      at org.apache.abdera2.activities.protocol.ActivitiesResponseContext.getContentType(ActivitiesResponseContext.java:88)
      at org.apache.abdera2.activities.protocol.ActivitiesResponseContext.<init>(ActivitiesResponseContext.java:50)
      at org.apache.abdera2.activities.protocol.ActivitiesResponseContext.<init>(ActivitiesResponseContext.java:41)
      at org.apache.abdera2.activities.protocol.AbstractActivitiesWorkspaceProvider.createErrorResponse(AbstractActivitiesWorkspaceProvider.java:88)
      at org.apache.abdera2.common.protocol.ProviderHelper.createErrorResponse(ProviderHelper.java:98)
      at org.apache.abdera2.common.protocol.ProviderHelper.createErrorResponse(ProviderHelper.java:87)
      at org.apache.abdera2.common.protocol.ProviderHelper.notfound(ProviderHelper.java:156)
      at org.apache.abdera2.common.protocol.ProviderHelper.notfound(ProviderHelper.java:160)
      at org.apache.abdera2.activities.protocol.basic.BasicAdapter$4.apply(BasicAdapter.java:228)
      at org.apache.abdera2.activities.protocol.basic.BasicAdapter$4.apply(BasicAdapter.java:1)
      at org.apache.abdera2.common.protocol.RequestProcessor.actuallyApply(RequestProcessor.java:68)
      at org.apache.abdera2.common.protocol.TransactionalRequestProcessor.apply(TransactionalRequestProcessor.java:62)
      at org.apache.abdera2.common.protocol.RequestProcessor.apply(RequestProcessor.java:1)
      at org.apache.abdera2.common.misc.Chain.next(Chain.java:48)
      at org.apache.abdera2.common.misc.Chain.apply(Chain.java:54)
      at org.apache.abdera2.common.protocol.AbstractProvider.apply(AbstractProvider.java:117)
      at org.apache.abdera2.common.protocol.AbstractProvider.apply(AbstractProvider.java:1)
      at org.apache.abdera2.common.protocol.servlet.AbstractAbderaServlet.process(AbstractAbderaServlet.java:89)
      at org.apache.abdera2.common.protocol.servlet.AbderaServlet.service(AbderaServlet.java:35)
      at org.apache.abdera2.examples.activities.ActivitiesServlet.service(ActivitiesServlet.java:21)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:355)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:567)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:147)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:126)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
      at org.mortbay.jetty.Server.handle(Server.java:248)
      at org.mortbay.jetty.HttpConnection.handlerRequest(HttpConnection.java:360)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:614)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:197)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:288)
      at org.mortbay.jetty.nio.SelectChannelConnector$HttpChannelEndPoint.run(SelectChannelConnector.java:805)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      Caused by: java.lang.UnsupportedOperationException
      at org.apache.abdera2.common.mediatype.MimeTypeHelper$UnmodifiableMimeType.setPrimaryType(MimeTypeHelper.java:465)
      at javax.activation.MimeType.parseMimeType(MimeType.java:123)
      at javax.activation.MimeType.<init>(MimeType.java:46)
      at org.apache.abdera2.common.mediatype.MimeTypeHelper$UnmodifiableMimeType.<init>(MimeTypeHelper.java:452)
      at org.apache.abdera2.common.mediatype.MimeTypeHelper.unmodifiableMimeType(MimeTypeHelper.java:400)
      at org.apache.abdera2.common.mediatype.MimeTypeHelper.createWildcard(MimeTypeHelper.java:68)
      at org.apache.abdera2.common.mediatype.MimeTypeHelper.<clinit>(MimeTypeHelper.java:45)
      at java.lang.J9VMInternals.initializeImpl(Native Method)
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
      ... 36 more

        Activity

        Hide
        James M Snell added a comment -

        Hmm... I'm not seeing this behavior on my end at all... leads me to think it's some wierdness in the underlying MimeType impl. From the looks of the stack trace, this is happening when MimeTypeHelper is initialized... can you post a test case that produces the error consistently for you and I'll run that on my end to see if I get back the same result.

        Show
        James M Snell added a comment - Hmm... I'm not seeing this behavior on my end at all... leads me to think it's some wierdness in the underlying MimeType impl. From the looks of the stack trace, this is happening when MimeTypeHelper is initialized... can you post a test case that produces the error consistently for you and I'll run that on my end to see if I get back the same result.
        Hide
        James M Snell added a comment -

        I believe the fix I just checked in should cover it. Please grab the latest and give it a test.

        Show
        James M Snell added a comment - I believe the fix I just checked in should cover it. Please grab the latest and give it a test.
        Hide
        Denny Pichardo added a comment -

        Hi James, the fix did resolve the issue. Thanks!

        Show
        Denny Pichardo added a comment - Hi James, the fix did resolve the issue. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Denny Pichardo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development