1 2 3 4 Previous Next 45 Replies Latest reply on Mar 3, 2014 6:28 AM by christinaktm Go to original post
      • 30. Re: memcached session manager and jboss
        martin.grotzke

        I  replaced the jar  , the jboss console show :

         

        2011-05-19 13:25:38,095 ERROR [STDERR] 2011-5-19 13:25:38 org.apache.tomcat.util.digester.Digester startElement

        严重: Begin event threw error

        java.lang.NoSuchMethodError: org.apache.tomcat.util.digester.Digester.getLogger()Lorg/jboss/logging/Logger;

         

        How did you start jboss, how can I reproduce this? (sorry for this stupid question, but I have absolute no knowledge about jboss :-))

        • 31. Re: memcached session manager and jboss
          jfclere

          For a running jbossweb instance, I wonder if manager.getContainer().getLoader().getClassLoader() will return the appropriate classloader. Can you tell this?

          Yep it should return Thread.currentThread().getContextClassLoader();

          • 32. Re: memcached session manager and jboss
            martin.grotzke

            Now I implemented a default Loader returning the Thread.currentThread().getContextClassLoader().

            Now everything compiles again, but it seems as if the Embedded tomcat does not evaluate the web.xml from the directory I passed to the StandardContext. The servlet specified in the web.xml just does not get instantiated, and each request going to the running tomcat is answered with status 400.

             

            With tomcat6 and tomcat7 I have the Embedded running fine, just with jbossweb I don't see what's missing.

             

            I have created a separate class that only contains the stuff for starting the embedded tomcat. After starting the embedded tomcat it just waits so that one can manually perform a request using a browser (to http://localhost:18888/).

            The class is in the msm-modules branch in the jbossweb3 module:

            https://github.com/magro/memcached-session-manager/blob/msm-modules/jbossweb3/src/test/java/de/javakaffee/web/msm/integration/TestEmbeddedJBW3.java

             

            The web.xml to load is located in the directory de/javakaffee/web/msm/integration/webapp/WEB-INF in src/main/resources.

             

            Can you help with this? What's missing so that jbossweb/Embedded uses the web.xml / Servlet specified therein?

            • 33. Re: memcached session manager and jboss
              jfclere

              the web.xml is not used you have to add the servlet/context/mapping programmaticly (See http://anonsvn.jboss.org/repos/mod_cluster/trunk/test/java/org/jboss/mod_cluster/JBossWeb.java)

              • 34. memcached session manager and jboss
                martin.grotzke

                the web.xml is not used you have to add the servlet/context/mapping programmaticly (See http://anonsvn.jboss.org/repos/mod_cluster/trunk/test/java/org/jboss/mod_cluster/JBossWeb.java)

                Thanx for this hint! Now I have added the servlet like this (you can also check the sources on github):

                 

                        final Wrapper wrapper = context.createWrapper();

                        wrapper.setName( "default" );

                        wrapper.setServletClass( TestServlet.class.getName() );

                        wrapper.setLoadOnStartup(1);

                        context.addChild(wrapper);

                        context.addServletMapping( "/*" , "default" );

                 

                But now there's an NPE during startup:

                 

                May 24, 2011 1:12:17 AM org.apache.catalina.core.StandardContext loadOnStartup

                ERROR: Servlet / threw load() exception

                java.lang.NullPointerException

                    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1162)

                    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108)

                    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3628)

                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3851)

                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1043)

                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:470)

                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1043)

                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:420)

                    at org.apache.catalina.startup.Embedded.start(Embedded.java:722)

                    at de.javakaffee.web.msm.integration.TestEmbeddedJBW3.main(TestEmbeddedJBW3.java:61)

                 

                It seems as if the InstanceManager is not initialized/set on the context. How can I get the servlet up and running?

                 

                Thanx && cheers,

                Martin

                • 35. memcached session manager and jboss
                  jfclere

                  Hm you are still using org.apache.catalina.startup.Embedded that won't work :-(

                  • 36. Re: memcached session manager and jboss
                    martin.grotzke

                    Hm you are still using org.apache.catalina.startup.Embedded that won't work :-(

                     

                    Sounds as if you had suggested anything different - I must have missed that.

                     

                    I'm using org.apache.catalina.startup.Embedded as msm core package provides base integration tests that are compiled against tomcat6 - the same tests are e.g. used to run tests against tomcat7. Only subtle changes in setup are extracted as overridable methods if the container under test needs special setup.

                     

                    Regarding your link to JBossWeb as part of tests for mod_cluster: this is built against jbossweb 2.1.7 btw, while I'm currently/still working on the integration of msm with jbossweb 3.0.

                    What did you want to tell me with the link? I thought you wanted to point out how to define/map the servlet programatically.

                     

                    Finally...

                    - Is it possible to start jbossweb 3.0.x using org.apache.catalina.startup.Embedded with some servlet serving requests?

                    - If so, what has to be done for this, how do I have to change my code?

                    - If it's not possible to pull up jbossweb 3.0.x using Embedded, what's the alternative?

                    - Can you provide an example how to run jbossweb 3.0.x embedded?

                     

                    Cheers,
                    Martin

                    • 37. Re: memcached session manager and jboss
                      jfclere

                      don't spend too much time of jbossweb 3.0.x it is just used for AS6 which won't be a supported product.

                       

                      AS7 will be the base for EAP7 so that the long term supported choice.

                       

                       

                       

                      Regarding your link to JBossWeb as part of tests for mod_cluster: this is built against jbossweb 2.1.7 btw, while I'm currently/still working on the integration of msm with jbossweb 3.0.

                      Oops right. I am using 7.0.0 in http://anonsvn.jboss.org/repos/jbossnative/trunk/build/unix/util/jbosswebtests/src/main/java/org/jboss/test/

                       

                       

                      Finally...

                      - Is it possible to start jbossweb 3.0.x using org.apache.catalina.startup.Embedded with some servlet serving requests?

                      - If so, what has to be done for this, how do I have to change my code?

                      - If it's not possible to pull up jbossweb 3.0.x using Embedded, what's the alternative?

                      - Can you provide an example how to run jbossweb 3.0.x embedded?

                       

                      Cheers,
                      Martin

                      1 - I have not tried it... The problem is that Embedded is broken and not supported.

                      2 - I am afraid the problems in Embedded would need to be fixed first.

                      3 - Using StandardService.
                      4 - I don't have a running one yet.

                      • 38. Re: memcached session manager and jboss
                        martin.grotzke

                        Hi David,

                        From what I'v read the JBoss6 JBossWeb is based on TomCat6 but it looks a bit different.

                         

                        I'd like to use the memcached session manager, is there a way to set it up?

                        http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration

                         

                        I'm still learning jboss, would be nice if there is a solution without changing a lot of code

                         

                        as JF wrote "jbossweb 3.0.x it is just used for AS6 which won't be a supported product. AS7 will be the base for EAP7 so that the long term supported choice.".

                         

                        Is AS7 an option for you? Then we could see how much effort it takes getting an embedded tomcat up and running with jbossweb 7 and integrate msm.

                        Otherwise, if JBoss6 (and the bundled JBossWeb 3) is your choice it seems that it's not really possible to bring msm integration tests together with JBW3. Without tests I wouldn't officially release a module. Perhaps we could put a version together that needs heavy manual testing.

                        • 39. Re: memcached session manager and jboss
                          martin.grotzke

                          Hi JF,

                           

                          thanx for this info.

                           

                          Cheers,

                          Martin

                          • 40. Re: memcached session manager and jboss
                            bone

                            Hi Martin,

                             

                            Jboss 7 is not yet an option. My boss said, if we upgrade, we need something proven stable, this is why we are currently using jboss 3 and 4.

                             

                            The version you've uploaded early seems to work without problems, as far as I can say tho. I have got the time for 'heavy manual' testing and would really like to create a version working with jbw3 and to learn more about jboss/memchached.

                             

                            Cheers,

                            David

                            • 41. Re: memcached session manager and jboss
                              martin.grotzke

                              The version you've uploaded early seems to work without problems, as far as I can say tho. I have got the time for 'heavy manual' testing and would really like to create a version working with jbw3 and to learn more about jboss/memchached.

                              The latest version that I uploaded is tracked in the msm-modules_jbossweb branch:

                              https://github.com/magro/memcached-session-manager/tree/msm-modules_jbossweb

                               

                              I will continue my work on the msm-modules branch (containing just tomcat6 and tomcat7) and keep my hands off  msm-modules_jbossweb. If you want to push the jbw3 version go ahead and fork msm / the mentioned branch. If you need help just ask, we should have such discussions then on the msm mailing list (http://groups.google.com/group/memcached-session-manager). If you have anything that should go back into the branch or msm itself you can place pull requests, I'll be happy to merge them :-)

                               

                              Cheers,

                              Martin

                              • 42. Re: memcached session manager and jboss
                                sam-user

                                Hi Martin,

                                the above discussion seems to be concerned mainly with JBoss 6.

                                I am using JBoss 5.1 and was wondering if msm can be used with that version of JBoss and how do I set it up?

                                Thanks.

                                • 43. Re: memcached session manager and jboss
                                  martin.grotzke

                                  Hi Sam,

                                   

                                  not sure if msm can be used with jboss 5.1. Documentation regarding msm can be found here: http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration

                                   

                                  Cheers,

                                  Martin

                                  • 44. Re: memcached session manager and jboss
                                    christinaktm

                                    H David,

                                    Could u please share  details on using memcached for jboss7 session persistence