facebook

JRUN4 launch from Eclipse doesn’t load JAAS?

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #230153 Reply

    ckevinhill
    Member

    Just curious if anyone has any insights why launching the JRUN4 application server from Eclipse would make hte JAAS modules not work… Looks like they aren’t even loaded. Running from the command line works perfectly fine (jrun.exe -start serverName).

    #230176 Reply

    Riyad Kalla
    Member

    We aren’t currently away of JRun4 not starting up properly, how do you have it configured in your JRun4 connector settings?

    #230302 Reply

    Scott Anderson
    Participant

    I just tried a simple configuration of JRun 4, only configuring the install location (c:\dev\appservers\JRun\JRun4 in my stall), server name (default), and JDK location (c:\j2sdk1.4.2_06). I then started and got the following output, which appears fine:

    
    Starting Macromedia JRun 4 (Build 61650), default server
    05/27 19:20:44 info JRun Naming Service listening on *:2908
    05/27 19:20:45 info No JDBC data sources have been configured for this server (see jrun-resources.xml)
    05/27 19:20:46 info JRun Web Server listening on *:8100
    05/27 19:20:46 info Deploying enterprise application "default-ear" from: file:/C:/dev/appservers/JRun/JRun4/servers/default/default-ear/
    05/27 19:20:47 info Deploying web application "JRun Default Web Application" from: file:/C:/dev/appservers/JRun/JRun4/servers/default/default-ear/
    05/27 19:20:48 info Web Services in default-ear#default-war:
    05/27 19:20:48 info AdminService
    05/27 19:20:48 user JSPServlet: init
    05/27 19:20:49 info Deploying web application "file:/C:/dev/appservers/JRun/JRun4/servers/default/DeployTest/" from: file:/C:/dev/appservers/JRun/JRun4/servers/default/DeployTest/
    05/27 19:20:49 user JSPServlet: init
    05/27 19:20:49 info Deploying web application "Struts-EL Taglib Exerciser" from: file:/C:/dev/appservers/JRun/JRun4/servers/default/StrutsELTest/
    05/27 19:20:49 user JSPServlet: init
    05/27 19:20:51 user action: init
    - Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    - Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    - Initializing, config='org.apache.struts.webapp.exercise.ApplicationResources', returnNull=true
    05/27 19:20:52 info Deploying web application "file:/C:/dev/appservers/JRun/JRun4/servers/default/TomcatTest/" from: file:/C:/dev/appservers/JRun/JRun4/servers/default/TomcatTest/
    05/27 19:20:52 user JSPServlet: init
    05/27 19:20:52 info Deploying enterprise application "JRun 4.0 Internal J2EE Components" from: file:/C:/dev/appservers/JRun/JRun4/lib/jrun-comp.ear
    05/27 19:20:52 info Deploying EJB "JRunSQLInvoker" from: file:/C:/dev/appservers/JRun/JRun4/lib/jrun-comp.ear
    05/27 19:20:53 info Deploying enterprise application "Macromedia Flash Remoting MX EAR" from: file:/C:/dev/appservers/JRun/JRun4/lib/flashgateway.ear
    05/27 19:20:53 info Deploying web application "Macromedia Flash Remoting MX" from: file:/C:/dev/appservers/JRun/JRun4/lib/flashgateway.ear
    05/27 19:20:53 user JSPServlet: init
    05/27 19:20:53 user FlashGatewayServlet: init
    Server default ready (startup time: 16 seconds)
    
    #240240 Reply

    ckevinhill
    Member

    We have our custom JAAS file in the jrun_root/servers/lib directory, and our auth.conf file in the server/SERVER-INF directory.
    Again, when starting the server outside of MyEclipse the JAAS auth works perfect, it’s only within Eclipse that the authentication modules aren’t being loaded.

    Is there some sort of classpathing, etc I need to consider?

    thanks,
    -K

    #240251 Reply

    Riyad Kalla
    Member

    Kevin,
    If you look into your jvm.config file in your /bin directory, are there any special JDK flags being used to specify the JAAS file? Most of the time when an app server isn’t running correctly, it’s an issue of duplicating the settings (flags, classpath, library path, etc.) in the connector settings to get it working.

    #240262 Reply

    ckevinhill
    Member

    config file looks pretty bare:

    
    #
    # VM configuration
    #
    # Where to find JVM, if {java.home}/jre exists then that JVM is used
    # if not then it must be the path to the JRE itself
    #
    # If no java.home is specified a VM is located by looking in these places in this
    # order:
    #
    #  1) JAVA_HOME environment variables (same rules as java.home above)
    #  2) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
    #  3) ../jre 
    #  4) registry (windows only)
    #
    
    #java.home=C:/Program Files/Java/jre1.5.0_05
    java.home=C:/Program Files/Java/j2re1.4.2_09
    
    # Arguments to VM
    
    java.args=-Xms32m -Xmx128m -Dsun.io.useCanonCaches=false
    
    # java.class.path - use this for adding individual jars or
    # directories.  When directories are included they will be searched
    # for jars and zips and they will be added to the classpath (in
    # addition to the directory itself), the jar to be used in launching
    # will be appended to this classpath
    
    java.class.path={application.home}/servers/lib
    
    #
    # where to find shared libraries, again use commas to separate entries
    
    java.library.path=
    

    Does it have to do with the {application.home} being different when launched from Eclipse?

    #240263 Reply

    Riyad Kalla
    Member

    I don’t believe so, we just need to figure out how is JRun launching itself differently when using JAAS versus not, and then duplicate that in MyEclipse’s connector.

    I’ve never used JAAS before, are you able to send me a config file to enable it, so I can drop it into my JRun4 install here locally and see if I can figure out what is going on? If so, please tell me how you are determining that JAAS is not working, is it an error message in the console? If it requires running code, please provide it along with a quick how-to.

    support@genuitec.com ATTN Riyad, with a link to this forum if you are able to send items for me to test here.

    #240266 Reply

    ckevinhill
    Member

    The only problem will be that the JAAS I have will be HP/P&G specific – uses our internal Wirekey services… you would probably be able to install the component but it would be very unhappy 😉 Let me see if I can make a “simple” mock-JAAS component that we can play with….

    #240269 Reply

    Riyad Kalla
    Member

    Thank you Kevin, as I mentioned JAAS is all alien to me, but just enough to figure out why the connector isn’t playing nice would be great.

    #240275 Reply

    ckevinhill
    Member

    Okay email with the MOCKJAAS.jar and auth.config file have been sent….

    Installation is pretty simple:
    1- copy the MOCKJAAS.jar file to your jrun_server_root/servers/lib directory
    2- copy the auth.config to to your (assuming server = default) jrun_server_root/servers/default/SERVER_INF directory

    In one of your default web applications modify your web.xml to something like:

    
        <security-constraint>    
            <web-resource-collection>
                <web-resource-name>All Pages</web-resource-name>
                <url-pattern>/*</url-pattern>  
                <http-method>GET</http-method>
                <http-method>POST</http-method>
                <http-method>HEAD</http-method>
                <http-method>DELETE</http-method>
            </web-resource-collection>      
             
            <auth-constraint>
                <role-name>GLO-ROLE</role-name>      
            </auth-constraint>
        </security-constraint>
        
        <login-config>
            <auth-method>BASIC</auth-method>
        </login-config>    
    

    The behaviour your should see is:

    When started with bin/jrun.exe -start default:
    A good amount of output (to system.out) and authentication no matter what user/password

    With MyEclipse:
    The one line that goes something like “unable to authenticate user ‘username'”

    #240295 Reply

    Riyad Kalla
    Member

    Charles,
    When I made the changes you specified (note: when you said “in one of your default web apps, so I used: JRun4\servers\default\default-ear\default-war\WEB-INF), and when I run JRun from within MyEclipse I get the following in the console (same as when run outside), does this look right?

    Starting Macromedia JRun 4.0 (Build 106363), default server
    10/27 15:44:30 info JRun Naming Service listening on *:2908
    10/27 15:44:31 info No JDBC data sources have been configured for this server (see jrun-resources.xml)
    10/27 15:44:31 info JRun Web Server listening on *:8100
    10/27 15:44:31 info Deploying enterprise application “JRun 4.0 Internal J2EE Components” from: file:/C:/Java/JRun4/lib/jrun-comp.ear
    10/27 15:44:31 info Deploying EJB “JRunSQLInvoker” from: file:/C:/Java/JRun4/lib/jrun-comp.ear
    10/27 15:44:31 info Deploying enterprise application “default-ear” from: file:/C:/Java/JRun4/servers/default/default-ear/
    10/27 15:44:31 info Deploying web application “JRun Default Web Application” from: file:/C:/Java/JRun4/servers/default/default-ear/
    10/27 15:44:32 info Web Services in default-ear#default-war:
    10/27 15:44:32 info AdminService
    10/27 15:44:32 warning default-war web application has ‘reload’ as true in jrun-web.xml. Consider setting it false if the application is running in production environment.
    10/27 15:44:32 warning default-war web application has ‘compile’ as true in jrun-web.xml. Consider setting it false if the application is running in production environment.
    10/27 15:44:32 user JSPServlet: init
    10/27 15:44:32 info Deploying enterprise application “Flash Remoting EAR” from: file:/C:/Java/JRun4/lib/flashgateway.ear
    10/27 15:44:32 info Deploying web application “Flash Remoting” from: file:/C:/Java/JRun4/lib/flashgateway.ear
    10/27 15:44:32 user JSPServlet: init
    10/27 15:44:32 user FlashGatewayServlet: init
    Server default ready (startup time: 4 seconds)

    NOTE: We just fixed a bug with JRun and Java 5 in the connector, the workaround is to use the following JDK optional parameters for the connector:
    -Xms32m -Xmx128m -Dsun.io.useCanonCaches=false -Djmx.invoke.getters=true

    (The two -D are the key ones, the -X ones are optional, I was just duplicating the default JRun params from the jvm.config file).

    #240935 Reply

    ckevinhill
    Member

    Hey sorry, didn’t get an email notification on this so didn’t notice your reply.

    Yes, that startup looks okay (just the default). You should start gettting more messages when you try to “view” a web application page. I’m using JDK1.4+ so the 1.5 CanonCaches fixes shouldn’t be an issue…

    #240949 Reply

    ckevinhill
    Member

    You get:

    
     11/07 10:21:48 user JSPServlet: init
    11/07 10:21:52 info Deploying enterprise application "JRun 4.0 Internal J2EE Components" from: file:/C:/Program Files/Jrun4/lib/jrun-comp.ear
    11/07 10:21:52 info Deploying EJB "JRunSQLInvoker" from: file:/C:/Program Files/Jrun4/lib/jrun-comp.ear
    11/07 10:21:52 info Deploying enterprise application "Flash Remoting EAR" from: file:/C:/Program Files/Jrun4/lib/flashgateway.ear
    11/07 10:21:53 info Deploying web application "Flash Remoting" from: file:/C:/Program Files/Jrun4/lib/flashgateway.ear
    11/07 10:21:53 user JSPServlet: init
    11/07 10:21:53 user FlashGatewayServlet: init
    Server default ready (startup time: 15 seconds)
    11/07 12:46:33 user jrun.servlet.RedirectServlet: init
    11/07 12:46:33 user FileServlet: init
    - Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    - Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    - Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    11/07 12:46:42 info Authentication of user hill.ck to view /webcc/ failed.  Either an invalid username or an invalid password was given.
    

    from within Eclipse and…

    
    Components" from: file:/C:/Program Files/Jrun4/lib/jrun-comp.ear
    11/07 12:52:26 info Deploying EJB "JRunSQLInvoker" from: file:/C:/Program Files/Jrun4/lib/jrun-comp.ear
    11/07 12:52:26 info Deploying enterprise application "Flash Remoting EAR" from: file:/C:/Program Files/Jrun4/lib/flashgateway.ear
    11/07 12:52:26 info Deploying web application "Flash Remoting" from: file:/C:/Program Files/Jrun4/lib/flashgateway.ear
    11/07 12:52:26 user JSPServlet: init
    11/07 12:52:26 user FlashGatewayServlet: init
    Server default ready (startup time: 6 seconds)
    11/07 12:52:37 user FileServlet: init
    MockLoginModule: Initializing MockLoginModule
    MockLoginModule: login
    MockLoginModule: User: hill.ck, Password: password
    MockLoginModule: commit
    MockLoginModule: Initializing MockLoginModule
    MockLoginModule: login
    MockLoginModule: Role to check: GLO-PG
    MockLoginModule: commit
    

    when launched outside of Eclipse.

    This fairly clearly shows the JAAS dependencies aren’t being loaded inside of Eclipse for some reason….

    #240994 Reply

    Riyad Kalla
    Member

    Kevin,
    I ahve filed this issue for investigation, thank you for the mock files, they will make this infinately easier to track down.

    #241008 Reply

    Riyad Kalla
    Member

    Ok I’m digging into this more and I actually cannot get the MockLoginModule to appear using the JRun launcher.

    I think the part I’m getting hung up on is editing the web.xml file, the module I edited was:
    C:\Java\jrun-4.0\servers\default\default-ear\default-war\WEB-INF

    and I changed the web.xml file to look like this:

    
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <!DOCTYPE web-app  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    
    
    <web-app>
    
        <display-name>JRun Default Web Application</display-name>
        <description>The default web application for JRun</description>
        
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    
        <error-page>
            <error-code>404</error-code>
            <location>/errorPages/404.jsp</location>
        </error-page>
    
        <security-constraint>
            <web-resource-collection>
                <web-resource-name>All Pages</web-resource-name>
                <url-pattern>/*</url-pattern>
                <http-method>GET</http-method>
                <http-method>POST</http-method>
                <http-method>HEAD</http-method>
                <http-method>DELETE</http-method>
            </web-resource-collection>
    
            <auth-constraint>
                <role-name>GLO-ROLE</role-name>
            </auth-constraint>
        </security-constraint>
    
        <login-config>
            <auth-method>BASIC</auth-method>
        </login-config>
    
    </web-app>
    

    Does that look correct? I continue to get the basic output in the console, no mention of Mock. I also dropped auth.config ontop of the existing one in the C:\Java\jrun-4.0\servers\default\SERVER-INF directory and dropped the JAR into C:\Java\jrun-4.0\servers\lib

    Please double check me.

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: JRUN4 launch from Eclipse doesn’t load JAAS?

You must be logged in to post in the forum log in