Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo 3.6.2 JAASRealm Valve LoginModule(Problem using an userdefined LoginModule )
Virgo 3.6.2 JAASRealm Valve LoginModule [message #1237376] Wed, 29 January 2014 14:54 Go to next message
Klaus Ungerhofer is currently offline Klaus UngerhoferFriend
Messages: 3
Registered: January 2014
Junior Member
Hello @all!

I have searched thie forum and the whole internt Razz and didn't andy solution for my problem. Therefore i raised a new topic.

I have implemented a JAASRealm, a LoginModule and a Valve extending AuthenticatorBase.
When i try to use it in Virgo 3.6.2 i get allways an Exception when i try to start Virgo.
Here the config i use:
file tomcat-server.xml (just the content inbetween the Engine tags)
<Engine name="Catalina" defaultHost="localhost">
<Realm className="at.invaris.jaas.InvarisJAASRealm" appName="invaris"
userClassNames="at.invaris.jaas.UserPrincipalImpl"
roleClassNames="at.invaris.jaas.RolePrincipalImpl"/>
<Host name="localhost" appBase=""
unpackWARs="false" autoDeploy="false"
deployOnStartup="false" createDirs="false">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="serviceability/logs/access"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>

<Valve className="org.eclipse.virgo.web.tomcat.support.ApplicationNameTrackingValve"/>
at.invaris.jaas.UserPrincipalImpl
<Valve className="at.invaris.jaas.auth.InvarisAuthenticator"/>
</Host>
</Engine>

file java6-server.profile
added following lines after org.eclipse.virgo.nano.authentication,\
at.invaris.jaas,\
at.invaris.jass.auth,\

file org.eclipse.virgo.kernel.authentication.config
added following lines

invaris {
at.invaris.jaas.TestLoginModule REQUIRED;
};

in the lib folder %VIRGO_HOME%\lib i putted a jar file with all needed classes

when i try to start i get an IllegalArgumentException
the Constructor of the Valve (InvarisAuthenticator) is called and the the Exception i thrown (log entries follow)

Constructor called for Class at.invaris.jaas.auth.InvarisAuthenticator
ester|facts|15:14:01|ERROR| End event threw exception java.lang.IllegalArgumentException: argument type mismatch
.
.
Error parsing Tomcat XML configuration.
at org.eclipse.gemini.web.tomcat.internal.OsgiAwareEmbeddedTomcat.configure(OsgiAwareEmbeddedTomcat.java:313)
at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainerFactory.createContainer(TomcatServletContainerFactory.java:27)
at org.eclipse.gemini.web.tomcat.internal.Activator.createContainer(Activator.java:107)
at org.eclipse.gemini.web.tomcat.internal.Activator.start(Activator.java:58)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 41 common frames omitted
Caused by: org.xml.sax.SAXParseException: Error at (44, 68) : argument type mismatch
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)


When i use the above situation in an standalone tomcat all works.

Any help or hint is wellcome!
Thank you in advance!

have a hace day!
Re: Virgo 3.6.2 JAASRealm Valve LoginModule [message #1295436 is a reply to message #1237376] Mon, 14 April 2014 09:07 Go to previous messageGo to next message
Klaus Ungerhofer is currently offline Klaus UngerhoferFriend
Messages: 3
Registered: January 2014
Junior Member
Hello again!
Really amazing almost 45500 reads and no answer!
Nevertheless i have solved the problem.

I will tell it to the community maybe someone of the 45000 readers needs the solution.

Here is the solution:
1.) I created a Fragment-Host bundle and set TomCat as Fragment-Host

Fragment-Host: org.eclipse.gemini.web.tomcat;bundle-version="[2.2.1.RELEASE,3.0.0.RELEASE)"
in the Import-Package Section i added all my packages for the valve and the login module

2.) I created a Bundle whitch imports all needed packages from Catalina, Servlet..
Import-Package:
org.apache.catalina.valves,
org.apache.catalina.authenticator,
org.apache.catalina.realm,
javax.security.auth.callback,
org.apache.catalina.deploy,
javax.servlet.http,
org.apache.catalina.connector,
org.apache.catalina,
javax.security.auth.spi,
javax.servlet
and exports here all packages which are imported in the Fragment-Host Bundle created in 1.)

Both bundles are deployed in the VIRGO_HOME/repository/usr repository

3.) define a Valve and the login module as discribed in the Virgo Dcoumentation / TomCat Realm Configuration

Hope it helps someone!

greets Klaus
Re: Virgo 3.6.2 JAASRealm Valve LoginModule [message #1299234 is a reply to message #1295436] Wed, 16 April 2014 20:43 Go to previous messageGo to next message
Florian Waibel is currently offline Florian WaibelFriend
Messages: 166
Registered: June 2010
Senior Member
Hi Klaus,

thanks for keeping us in the loop.

Regards,
florian
Re: Virgo 3.6.2 JAASRealm Valve LoginModule [message #1299812 is a reply to message #1237376] Thu, 17 April 2014 06:09 Go to previous message
Klaus Ungerhofer is currently offline Klaus UngerhoferFriend
Messages: 3
Registered: January 2014
Junior Member
Hi Florian,

U r wellcome. I got help from the forum as well so i can give back a bit!

happy day! Razz
Previous Topic:Cannot find declaration of element beans
Next Topic:[resolved] CXF failed to publish endpoints in Eclipse 4.2.2 OSGi, Jetty 8.1.14 and Spring 3.0.7 env
Goto Forum:
  


Current Time: Fri Apr 19 12:36:21 GMT 2024

Powered by FUDForum. Page generated in 0.01813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top