-
15. Re: memcached session manager and jboss
martin.grotzke May 13, 2011 10:15 AM (in response to bone)Hi David,
This seems to be another difference of jbossweb and tomcat.
I'm just checking out if I can create a version for jbossweb...
Cheers,
Martin
-
16. Re: memcached session manager and jboss
martin.grotzke May 15, 2011 7:12 PM (in response to bone)Hi David,
I have created a version that should work with jbossweb (built against 2.1.7.GA). It's based on a new structure of msm, which I'm currently working on and hope to release soon.
Unfortunately I couldn't get integration tests of msm to work with jbossweb due to some changes compared to tomcat.
As I couldn't change loggers in core msm to jboss logger, I introduced an adapter for juli -> jbosslogging, with the effect, that the printed class/method is always my logadapter.info (debug or whatelse), also needs to be fixed (but doesn't compromise functionality).
There are now 2 msm jars you have to put into lib: the core msm jar and the jboss specific one:
http://dl.dropbox.com/u/1439289/msm-all-memcached-session-manager-1.5.0-SNAPSHOT.jar
http://dl.dropbox.com/u/1439289/msm-all-memcached-session-manager-jbossweb2-1.5.0-SNAPSHOT.jar
Cheers,
Martin
-
17. memcached session manager and jboss
martin.grotzke May 15, 2011 7:28 PM (in response to martin.grotzke)I think to make a jbossweb version you should just add the dependencies to jbossweb and jbosslogging and rebuild your package.
I don't find a jbossweb 6.x artifact, only some 3.x (jboss.web.jbossweb) or 7.x (org.jboss.web), using the nexus search.
Can you point me to the dependency spec (groupId:artifactId:version) and a repository that I need to include for jboss6 jbossweb?
After digging around I chose these deps:
jboss.web:jbossweb:2.1.7.GA
org.jboss.logging:jboss-logging:3.0.0.Beta2
And this repo: https://repository.jboss.org/nexus/content/repositories/releases
I noticed semantical changes in StandardSession.{thisAccessedTime,lastAccessedTime} so that I had to change some msm code for this.
Do you know other semantical changes like these?
Now I have some issues left:
1) In integration tests I start several embedded tomcats (using Embedded). The MapperListener.registerHost unfortunately uses the static ServerFactory.getServer() which always returns the first tomcat, so that for the second tomcat the engine cannot be found and an NPE is thrown. Do you have an idea how this can be fixed?
2) I have integrations tests with container managed autentication. For tomcat (6, 7) I'm setting up a NamingContext with a MemoryUserDatabase, which does not exist. Additionally I'm setting a UserDatabaseRealm which is also not available in jbossweb. You can have a look at the code here. Can I do the same with jbossweb?
3) Logging: I couldn't replace the juli Log references in msm core to use jboss logging Logger. For this I introduced an adapter from juli -> jboss logging. This has the effect that the printed class/method is always my introduced adapter (due to the additional method call / stack frame). Do you have an idea how I could come around this?
Shall we contain discussing this here in this thread, or do you suggest s.th. else?
Thx && cheers,
Martin
-
18. Re: memcached session manager and jboss
jfclere May 16, 2011 4:21 AM (in response to martin.grotzke)https://repository.jboss.org/nexus/content/groups/public/org/jboss/web/jbossweb/ 3.0.x is for AS7 and 7.0.x for AS7.
-
19. Re: memcached session manager and jboss
martin.grotzke May 16, 2011 5:34 AM (in response to jfclere)https://repository.jboss.org/nexus/content/groups/public/org/jboss/web/jbossweb/ 3.0.x is for AS7 and 7.0.x for AS7.
Typo? What's the difference between AS7 and AS7? Or is 3.0.x for AS6?
Which version exactly should I use for Jboss AS6 Jbossweb? 3.0.0-CR1? What's the meaning of "CR" here btw?
Did you see my other questions?
-
20. Re: memcached session manager and jboss
jfclere May 16, 2011 5:48 AM (in response to martin.grotzke)Oops typo 3.0.x for AS6 and 7.0.x for AS7.
-
21. memcached session manager and jboss
martin.grotzke May 17, 2011 7:11 AM (in response to jfclere)Ok, I changed the dependency to org.jboss.web:jbossweb:3.0.0-CR1.
Now I'm stuck at finding an appropriate Loader implementation to set on the context. Is there a replacement for WebappLoader?
-
22. memcached session manager and jboss
jfclere May 18, 2011 4:14 AM (in response to martin.grotzke)Hm in fact you will need to use a servlet 3.0 session listener. The + is that would work for all servlet 3.0 containers.
-
23. memcached session manager and jboss
huangkr May 18, 2011 5:27 AM (in response to martin.grotzke)hi,how to use the memcached session manager and jboss on jboss4.2.2GA
http://dl.dropbox.com/u/1439289/memcached-session-manager-1.4.2-SNAPSHOT.jar is not open ?
huangsb@ulhuangsb@uleathanks please send it my mail huangsb@ulearning.cn
-
24. memcached session manager and jboss
martin.grotzke May 18, 2011 5:45 AM (in response to jfclere)Perhaps we're talking about different things. I'm trying to get the embedded tomcat (that I'm using for integration tests) running with jbossweb 3.x.
With WebappLoader I was referring to the setup of a StandardContext for integration-testing and setting a Loader on the context (like following uncommented lines):
https://github.com/magro/memcached-session-manager/blob/msm-modules/jbossweb3/src/test/java/de/javakaffee/web/msm/integration/TestUtilsJBW3.java#L281
As a side note: I just pushed my work-in-progress to github so that you can have a look at the current state of implementation. The TestUtilsJBW3 shows the jbossweb3 specific version (needs much cleanup when things compile and run).
The problem is that I see the Loader interface in jbossweb 3.x but no implementation and in particular no WebappLoader.
I need this as the MemcachedSessionService (main class of msm) during initialization loads the configured TranscoderFactory (responsible for serializing/deserializing sessions) using the classloader of the WebappLoader:
Can you help with this? Is there a replacement of the WebappLoader in jbw3, how could I solve this differently so that it works with jbossweb?
-
25. memcached session manager and jboss
martin.grotzke May 18, 2011 9:06 AM (in response to huangkr)hi,how to use the memcached session manager and jboss on jboss4.2.2GA
http://dl.dropbox.com/u/1439289/memcached-session-manager-1.4.2-SNAPSHOT.jar is not open ?
I can still download this file, but I also just sent you an email with it attached.
But be warned, it's compiled against jbossweb 2.1.7 (IIRC), and I'm not sure if it's really working (at runtime) with jbossweb 2.1.7.
The problem is that jbossweb contains some changes compared to tomcat that breaks some of the memcached-session-manager integration tests related to container managed authentication, so that I can't run the whole test suite.
Additionally I don't know which version of jbossweb jboss4.2.2GA really uses.
So everything is on your own risk - as always :-)
Still, if you can tell me which version of jbossweb is used by jboss4.2.2GA I can see if I can build an msm version against this and we see how far we can push it (with the help of Jean-Frederic :-)).
Cheers,
Martin -
26. Re: memcached session manager and jboss
huangkr May 18, 2011 11:05 PM (in response to martin.grotzke)thanks a lot
About jboss-web at jboss4.2.2GA description ,detail please attach ,thanks.
JBoss Web v2.x is the web container in JBossAS 4.2, an implementation based on Apache Tomcat that includes the Apache Portable Runtime (APR) and Tomcat native technologies to achieve scalability and performance characteristics that match and exceed the Apache Http server. In the absence of the native libraries, JBoss Web falls back to the standard non-native connector mode. The native libraries need to be downloaded and installed separately in JBOSS_HOME/bin/native.
readme.html
-
readme.html.zip 11.7 KB
-
-
27. memcached session manager and jboss
jfclere May 19, 2011 4:09 AM (in response to martin.grotzke)In 7.0.x we don't use Embedded but the StandardService.
I think the WebappLoader could be replaced by your own Loader implementation you just need the ClassLoader correct?
-
28. memcached session manager and jboss
huangkr May 19, 2011 4:39 AM (in response to jfclere)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;
at org.apache.catalina.startup.SetParentClassLoaderRule.begin(Catalina.java:704)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:514)
at org.apache.catalina.startup.Catalina.start(Catalina.java:568)
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:597)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.JBossWeb.startService(JBossWeb.java:440)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at org.jboss.system.ServiceController.start(ServiceController.java:435)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
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.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
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:597)
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.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
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.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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:597)
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(Abstract
-
29. Re: memcached session manager and jboss
martin.grotzke May 19, 2011 5:53 AM (in response to jfclere)In 7.0.x we don't use Embedded but the StandardService.
Ok, I'll have a look at this as soon as I start creating a msm version for jbossweb 7.0.x
I think the WebappLoader could be replaced by your own Loader implementation you just need the ClassLoader correct?
Right. The correct classloader is the classloader that's used for webapp classes (loaded from WEB-INF/classes or WEB-INF/lib).
For integration tests I can just use the classloader of the current thread.
For a running jbossweb instance, I wonder if manager.getContainer().getLoader().getClassLoader() will return the appropriate classloader. Can you tell this?