10 Replies Latest reply: Jul 23, 2013 12:33 AM by a_s_mon RSS

    Custom authentication with BlazeDS on Tomcat

    yankee2003 Community Member

      Hello!

       

      I did the following:

       

      You need to perform the following configuration steps to use custom authentication with
      BlazeDS on Tomcat:

       

      1. Put flex-tomcat-common.jar in tomcat/lib/blazeds.
      2. Place flex-tomcat-server.jar in tomcat/lib/blazeds.
      3. Edit the catalina.properties file which can be found in the tomcat/conf directory. Find the common.loader property and add the following path to the end of the list: ${catalina.home}/lib/blazeds/*.jar
      4. Add <Valve className="flex.messaging.security.TomcatValve"/> tag to the Context Descriptors.
      5. Restart Tomcat.

       

      You will now be authenticated against the current Tomcat realm. Usually, for this authentication the user information is in conf/tomcat-users.xml. See the Tomcat documentation for more information on realms. See the Flex documentation for more information on BlazeDS custom authentication.

       

      ---

       

      When I started Tomcat 7 from Eclipse I got the stacktrace below.

       

      Seems to be a version clash.

      Any tips?

       

      Regards,

      Stefan

       

      ---

       

      java.lang.VerifyError: class flex.messaging.security.TomcatValve overrides final method start.()V
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
          at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:140)
          at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXPars er.java:501)
          at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Abstrac tXMLDocumentParser.java:179)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X MLDocumentFragmentScannerImpl.java:1343)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDri ver.next(XMLDocumentFragmentScannerImpl.java:2755)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImp l.java:648)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:511)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:808)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:737)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :1205)
          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.j ava:522)
          at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:529)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:567)
          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.catalina.startup.Bootstrap.load(Bootstrap.java:262)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417)
      java.lang.reflect.InvocationTargetException
          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.catalina.startup.Bootstrap.load(Bootstrap.java:262)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417)
      Caused by: java.lang.VerifyError: class flex.messaging.security.TomcatValve overrides final method start.()V
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
          at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:140)
          at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXPars er.java:501)
          at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Abstrac tXMLDocumentParser.java:179)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X MLDocumentFragmentScannerImpl.java:1343)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDri ver.next(XMLDocumentFragmentScannerImpl.java:2755)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImp l.java:648)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:511)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:808)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:737)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :1205)
          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.j ava:522)
          at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:529)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:567)
          ... 6 more