[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

JIRA jira@codehaus.org
Issue Type: Bug Bug
Affects Versions: 8.1.7
Assignee: Unassigned
Components: Maven
Created: 15/Oct/12 8:34 PM
Description:

With:
<scanIntervalSeconds>3</scanIntervalSeconds>

The declared HashLoginService fails to reload properly, causing:
java.lang.IllegalStateException: LoginService has different IdentityService to org.eclipse.jetty.security.ConstraintSecurityHandler

The workaround is to declare in jetty-web.xml:
<New id="DefaultLoginService" class="org.eclipse.jetty.security.HashLoginService">
...
<Get id="DefaultIdentityService" name="identityService" />
</New>

<!-- will probably leak the old identity service and associated components upon many restarts of the maven plugin -->
<Get name="securityHandler">
<Set name="identityService">
<Ref id="DefaultIdentityService" />
</Set>
<Set name="loginService">
<Ref id="DefaultLoginService" />
</Set>
</Get>

Project: Jetty
Priority: Major Major
Reporter: Paul Alesius
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

JIRA jira@codehaus.org
Change By: Jan Bartel (15/Oct/12 9:40 PM)
Assignee: Jan Bartel
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Jan Bartel commented on Bug JETTY-1549

Paul,

I can't reproduce this with the standard test-jetty-webapp. Can you attach a pom.xml that demonstrates the problem?
thanks,
Jan

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

Jan,

I've attached a test project showing this behavior.

Run "install" in eclipse and wait for it to start, edit the file in src/main/java and save to make it recompile; Jetty will restart, throwing: java.lang.IllegalStateException: LoginService has different IdentityService to org.eclipse.jetty.security.ConstraintSecurityHandler@2179e0ae

Change By: Paul Alesius (19/Oct/12 1:38 AM)
Attachment: com.example.test.zip
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1549) jetty-maven-plugin fails to reload the LoginService properly

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Jan Bartel resolved Bug JETTY-1549 as Fixed

Fixed for jetty-9. For jetty-7 and jetty-8, I suggest a workaround, where the identityService is explicitly configured:

<pre>
<Configure class="org.eclipse.jetty.webapp.WebAppContext">

<Get name="securityHandler">
<Set name="identityService">
<New id="idService" class="org.eclipse.jetty.security.DefaultIdentityService"/>
</Set>
<Set name="loginService">
<New id="DefaultLoginService" class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">MyRealm</Set>
<Set name="config">src/main/webapp/WEB-INF/realm.properties</Set>
<Set name="refreshInterval">5</Set>
<Set name="identityService"><Ref id="idService"/></Set>
</New>
</Set>
</Get>

</Configure>
</pre>

A couple of other tips:

1. The call to start on the SecurityHandler in jetty-web.xml shouldn't be necessary, as it should be started as the context is started.

2. You should probably use the jetty "start" mojo, rather than "run", as "start" was designed specifically for use in execution bindings in the pom, rather than from the command line (for which "run" was designed). Here's some doc on that: http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin#jetty:start__:__Starting_jetty_without_first_executing_the_build_up_to_.22test-compile.22_phase

regards,
Jan

Change By: Jan Bartel (04/Nov/12 10:18 PM)
Resolution: Fixed
Fix Version/s: 9.0.0
Status: Open Resolved
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email