Does Glassfish recognize context.xml?

View: New views
8 Messages — Rating Filter:   Alert me  

Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

cat /opt/glassfish/domains/domain1/applications/j2ee-modules/tunnel-web/META-INF/context.xml

<Context>
        <Realm
                className="org.apache.catalina.realm.JAASRealm"
                appName="PortalRealm"
                userClassNames="PortalPrincipal"
                roleClassNames="PortalRole"
        />
</Context>

I have not created a Glassfish Realm. But I am deploying an application that works on Tomcat 5 & 6 on Glassfish and I am seeing some JAAS realm related errors when I access this webapp.

The following is the stack trace:
~~~~~~~~~~~~~~~~~~~~~~
[#|2008-04-15T13:21:19.542+0200|SEVERE|sun-appserver9.1|org.apache.coyote.tomcat5.CoyoteAdapter|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=a65284c3-5567-4f48-8a2d-662706187968;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.ClassCastException: org.apache.catalina.realm.JAASRealm cannot be cast to com.sun.web.security.RealmAdapter
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:89)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at
~~~~~~~~~~~~~~~~~~~~~~

From my limited knowledge of GFV2, realms are only defined in the domain.xml. However I have no such entries in it. So is GFV2 pasring the context.xml inside my webapp and trying to initialize a realm based on its content?

Is this a bug/feature?

thanks,
_raju
[Message sent by forum member 'uppalapati' (uppalapati)]

http://forums.java.net/jive/thread.jspa?messageID=287439

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, GlassFish supports Tomcat's context.xml (see http://weblogs.java.net/blog/amyroh/archive/2007/05/context_webapp_1.html), except for its realm configuration.

See

  http://developers.sun.com/appserver/reference/techart/as8_authentication/index.html

for how to configure realms in GlassFish.
[Message sent by forum member 'jluehe' (jluehe)]

http://forums.java.net/jive/thread.jspa?messageID=287780

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Apparently its trying to even initialize the realm configuration just like tomcat but obviously the JAAS realm impl I have was for Tomcat and Glassfish is failing due to the realm mentioned in context.xml.

So is the expected behavior?
[Message sent by forum member 'uppalapati' (uppalapati)]

http://forums.java.net/jive/thread.jspa?messageID=287803

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For now, please remove the realm declaration from your context.xml. I will change the context initialization code to log a warning if a realm is present in context.xml. The log message will mention that the realm is going to be ignored..
[Message sent by forum member 'jluehe' (jluehe)]

http://forums.java.net/jive/thread.jspa?messageID=288091

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've filed this GlassFish issue:

  https://glassfish.dev.java.net/issues/show_bug.cgi?id=5347
[Message sent by forum member 'jluehe' (jluehe)]

http://forums.java.net/jive/thread.jspa?messageID=288550

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks. V3 is shaping out to be a quality release with all these fixes.
[Message sent by forum member 'uppalapati' (uppalapati)]

http://forums.java.net/jive/thread.jspa?messageID=288583

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jan,
Can you please let me know where I can find the context.xml DTD supported by GFV2 and V3?
I could not find any blogs or docs that describe the web app level config thats allowed in context.xml

It appears the webapp level configuration feature in Glassfish does not have feature parity with Tomcat. For example,

One cannot define a Realm, JDBC Resource etc. We can only reference existing resources defined in domain.xml

thanks,
_raju
[Message sent by forum member 'uppalapati' (uppalapati)]

http://forums.java.net/jive/thread.jspa?messageID=289137

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Does Glassfish recognize context.xml?

by glassfish-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Raju, the only blog we have about context.xml support in GlassFish is from Amy, which I referenced above.

Tomcat does not defined any DTD for context.xml, and therefore, GlassFish does not define one either.

I noticed you've already filed

  https://glassfish.dev.java.net/issues/show_bug.cgi?id=5376

Thanks for doing that!

Jan
[Message sent by forum member 'jluehe' (jluehe)]

http://forums.java.net/jive/thread.jspa?messageID=289166

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price