0 Replies Latest reply on Feb 21, 2006 6:19 PM by Rob

    Brand new to jboss < a couple questions >

    Rob Newbie

      Hi I am a new user of jboss. We currently use tomcat and are looking to switch to jboss for our webapps. I have two question which are pretty basic I would guess that I can't seem to figure out.

      The first question is we have apache 2.2 with mod_proxy_ajp that is controlling everything and I would like to learn where and how I configure sticky sessions in jboss for one of our apps that users the jsession.

      The second is I have when in tomcat you have the tomcat-users.xml file where you can add users and roles. In jboss where and how is this configured? I have looked at the documentation and tried to set this up without succes. Here is a copy of the web.xml from my app when on tomcat.

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
      <web-app id="WebApp">
      <display-name>Psc400</display-name>
      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Psc400</realm-name>
      <form-login-config>
      <form-login-page>login.html</form-login-page>
      <form-error-page>loginError.html</form-error-page>
      </form-login-config>
      </login-config>
      <!--

      <filter-name>snoop</filter-name>
      <filter-class>com.arkona.web.apps.psc400.utils.SnoopFilter</filter-class>


      <filter-mapping>
      <filter-name>snoop</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      -->

      <servlet-name>invoker</servlet-name>
      <servlet-class>
      org.apache.catalina.servlets.InvokerServlet
      </servlet-class>
      <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>


      <servlet-name>Psc400Init</servlet-name>
      <display-name>Psc400Init</display-name>
      <servlet-class>Psc400Init</servlet-class>
      <init-param>
      <param-name>SERVER_TYPE</param-name>
      <param-value>*WDSC</param-value>
      </init-param>
      <load-on-startup>-1</load-on-startup>


      <servlet-name>logout</servlet-name>
      <display-name>logout</display-name>
      <servlet-class>com.arkona.web.apps.psc400.utils.LogoutServlet</servlet-class>
      <load-on-startup>2</load-on-startup>

      <servlet-mapping>
      <servlet-name>invoker</servlet-name>
      <url-pattern>/servlet/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>logout</servlet-name>
      <url-pattern>/logout</url-pattern>
      </servlet-mapping>
      <security-role>
      <role-name>EISPBDD</role-name>
      </security-role>
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Psc400</web-resource-name>
      <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
      <role-name>EISPBDD</role-name>
      </auth-constraint>
      <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
      </security-constraint>
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      </web-app>


      and here is what I have when I tried to configure jboss

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
      <web-app id="WebApp">
      <display-name>Psc400</display-name>
      <!--
      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Psc400</realm-name>
      <form-login-config>
      <form-login-page>login.html</form-login-page>
      <form-error-page>loginError.html</form-error-page>
      </form-login-config>
      </login-config>
      -->
      <!--
      A security constraint that restricts access to the HTML JMX console
      to users with the role JBossAdmin. Edit the roles to what you want and
      uncomment the WEB-INF/jboss-web.xml/security-domain element to enable
      secured access to the HTML JMX console.
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>HtmlAdaptor</web-resource-name>
      An example security config that only allows users with the
      role JBossAdmin to access the HTML JMX console web application

      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>EISPBDD</role-name>
      </auth-constraint>
      </security-constraint>


      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Psc400</realm-name>
      </login-config>

      <security-role>
      <role-name>EISPBDD</role-name>
      </security-role>
      -->
      <!--

      <filter-name>snoop</filter-name>
      <filter-class>com.arkona.web.apps.psc400.utils.SnoopFilter</filter-class>


      <filter-mapping>
      <filter-name>snoop</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      -->

      <servlet-name>invoker</servlet-name>
      <servlet-class>
      org.apache.catalina.servlets.InvokerServlet
      </servlet-class>
      <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>


      <servlet-name>Psc400Init</servlet-name>
      <display-name>Psc400Init</display-name>
      <servlet-class>Psc400Init</servlet-class>
      <init-param>
      <param-name>SERVER_TYPE</param-name>
      <param-value>*WDSC</param-value>
      </init-param>
      <load-on-startup>-1</load-on-startup>


      <servlet-name>logout</servlet-name>
      <display-name>logout</display-name>
      <servlet-class>com.arkona.web.apps.psc400.utils.LogoutServlet</servlet-class>
      <load-on-startup>2</load-on-startup>

      <servlet-mapping>
      <servlet-name>invoker</servlet-name>
      <url-pattern>/servlet/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>logout</servlet-name>
      <url-pattern>/logout</url-pattern>
      </servlet-mapping>
      <security-role>
      <role-name>EISPBDD</role-name>
      </security-role>
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Psc400</web-resource-name>
      <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
      <role-name>EISPBDD</role-name>
      </auth-constraint>
      <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
      </security-constraint>
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      </web-app>

      now I have commented out some stuff trying to get this to work. I get the login prompt fine but get this error from the server console

      2006-02-19 19:35:36,561 ERROR [org.jboss.security.auth.spi.UsersRolesLoginModule] Failed to load users/passwords/role files
      java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
      at org.jboss.security.auth.spi.Util.loadProperties(Util.java:313)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
      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:585)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
      at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:587)
      at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:521)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:330)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:306)
      at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:256)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      2006-02-19 19:50:41,728 DEBUG [org.jboss.console.remote.InvokerServlet] Invoke threw exception
      ClientAbortException: java.net.SocketException: Broken pipe
      at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366)
      at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:403)
      at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:323)
      at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392)
      at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381)
      at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:88)
      at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1676)
      at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1585)
      at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1395)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:294)
      at org.jboss.console.remote.InvokerServlet.processRequest(InvokerServlet.java:115)
      at org.jboss.console.remote.InvokerServlet.doPost(InvokerServlet.java:148)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.net.SocketException: Broken pipe
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      2006-02-19 19:50:41,730 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web-console].[HTTP Invocation]] Servlet.service() for servlet HTTP Invocation threw exception
      java.lang.IllegalStateException
      at org.apache.catalina.connector.ResponseFacade.resetBuffer(ResponseFacade.java:285)
      at org.jboss.console.remote.InvokerServlet.processRequest(InvokerServlet.java:124)
      at org.jboss.console.remote.InvokerServlet.doPost(InvokerServlet.java:148)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      2006-02-19 19:50:41,731 WARN [org.apache.jk.core.MsgContext] Error sending end packet
      java.net.SocketException: Broken pipe
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:508)
      at org.apache.jk.common.JkInputStream.endMessage(JkInputStream.java:112)
      at org.apache.jk.core.MsgContext.action(MsgContext.java:293)
      at org.apache.coyote.Response.action(Response.java:182)
      at org.apache.coyote.Response.finish(Response.java:304)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:204)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)
      2006-02-19 19:50:41,732 WARN [org.apache.jk.common.ChannelSocket] processCallbacks status 2
      2006-02-19 19:55:01,787 DEBUG [org.jboss.console.remote.InvokerServlet] Invoke threw exception
      java.io.IOException
      at org.apache.jk.common.JkInputStream.receive(JkInputStream.java:189)
      at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:163)
      at org.apache.coyote.Request.doRead(Request.java:427)
      at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:283)
      at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:379)
      at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:298)
      at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:192)
      at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2217)
      at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2230)
      at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750)
      at java.io.ObjectInputStream.(ObjectInputStream.java:268)
      at org.jboss.console.remote.InvokerServlet.processRequest(InvokerServlet.java:95)
      at org.jboss.console.remote.InvokerServlet.doPost(InvokerServlet.java:148)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)


      Any help on these would be great as we would really love to switch to jboss