7 Replies Latest reply on Jun 20, 2007 12:25 PM by claprun

    Classpath problem with GATE

    kevinncsu

      Hello,

      The application I'm working on requires a file gate.jar to be listed on the classpath as it needs to load classes dynamically. This seems to be causing my portal to throw exceptions when I try to view it, though the JBoss AS boots up without errors.

      If gate.jar is removed from the JBOSS_CLASSPATH environment variable the portal works fine. Also the application I'm developing works fine on same JBoss AS without the portal installed and said environment variables set.

      Any suggestions on how to get this jar file so it can load classes dynamically from it and still have my portal running would be much appreciated!


      Information and stack trace follows:

      JBoss AS / Portal:

      Installed bundled JBoss AS 4.0.4GA with Portal 2.4.0GA using the portal profile in the jems-installer-1.2.0BETA2

      ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/portal].[PortalServletWithPathMapping]] Servlet.service() for servlet PortalServletWithPathMapping threw exception
      java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setCharacterEncoding(Ljava/lang/String;)V
      at org.jboss.portal.theme.LayoutDispatcher.include(LayoutDispatcher.java:122)
      at org.jboss.portal.theme.impl.JSPLayout.assembleResponse(JSPLayout.java:34)
      at org.jboss.portal.core.command.MarkupCommand.execute(MarkupCommand.java:360)
      at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:91)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
      at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:171)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.PageNavigationInterceptor.invoke(PageNavigationInterceptor.java:80)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:79)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:59)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
      at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:102)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:91)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:78)
      at org.jboss.portal.core.CoreController.handle(CoreController.java:126)
      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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:287)
      at $Proxy133.handle(Unknown Source)
      at org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:79)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:140)
      at org.jboss.portal.server.aspects.server.NavigationInterceptor.invoke(NavigationInterceptor.java:64)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:65)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:74)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:174)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:92)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
      at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:275)
      at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
      at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:37)
      at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
      at org.jboss.portal.server.servlet.PortalServlet.process(PortalServlet.java:294)
      at org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:172)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)



        • 1. Re: Classpath problem with GATE
          claprun

          When you mention GATE, are you referring to the General Architecture for Text Engineering project? If yes, which version and are you using ANNIE?

          • 2. Re: Classpath problem with GATE
            kevinncsu

            Yes, I believe we are using gate-3.1-build2270 and that we are using ANNIE though I will need to follow up on that to be sure.

            • 3. Re: Classpath problem with GATE
              kevinncsu

              Yep, that is correct, it is the 3.1 version

              • 4. Re: Classpath problem with GATE
                claprun

                The problem most likely comes from the fact that you might have bundled a version of the servlet API when deploying GATE/ANNIE. You should check that that's not the case. Check which version (and from where) HttpServletResponse is loaded by using the information at http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions

                • 5. Re: Classpath problem with GATE
                  kevinncsu

                  Yea, it seems it is trying to load HttpServletResponse from Gate. Here is the result of the invocation of displayClassInfo():

                  javax.servlet.http.HttpServletResponse Information
                  Repository cache version:
                  javax.servlet.http.HttpServletResponse(ad9f8a).ClassLoader=sun.misc.Launcher$AppClassLoader@a39137
                  ..sun.misc.Launcher$AppClassLoader@a39137
                  ....file:/C:/Program%20Files/JBoss-Portal/server/default/lib/gate.jar
                  ....file:/C:/Program%20Files/Java/jdk1.5.0_09/lib/tools.jar
                  ....file:/C:/Program%20Files/JBoss-Portal/bin/run.jar
                  ..sun.misc.Launcher$ExtClassLoader@92e78c
                  ....file:/C:/Program%20Files/Java/jdk1.5.0_09/jre/lib/ext/dnsns.jar
                  ....file:/C:/Program%20Files/Java/jdk1.5.0_09/jre/lib/ext/localedata.jar
                  ....file:/C:/Program%20Files/Java/jdk1.5.0_09/jre/lib/ext/sunjce_provider.jar
                  ....file:/C:/Program%20Files/Java/jdk1.5.0_09/jre/lib/ext/sunpkcs11.jar
                  ++++CodeSource: (file:/C:/Program%20Files/JBoss-Portal/server/default/lib/gate.jar )
                  Implemented Interfaces:
                  ++interface javax.servlet.ServletResponse(c54b88)
                  ++++ClassLoader: sun.misc.Launcher$AppClassLoader@a39137
                  ++++CodeSource: (file:/C:/Program%20Files/JBoss-Portal/server/default/lib/gate.jar )

                  ### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3@766a24{ url=null ,addedOrder=2}


                  ### Instance1 via UCL: sun.misc.Launcher$AppClassLoader@a39137

                  • 6. Re: Classpath problem with GATE
                    kevinncsu

                    I can't seem to separate out the servlet jar on Gate's buildpath and still get it to work.

                    Is there any way to stop the portal from attempting to use the implementation in Gate?

                    • 7. Re: Classpath problem with GATE
                      claprun

                      I don't know enough about GATE and how it's installed to answer this question properly. That said, ideally, gate.jar should be a library of your web app and therefore, packaged with your web app, not put in server/default/lib.