8 Replies Latest reply on Feb 25, 2008 4:00 PM by jamesjmp

    Accesing problem JBOSS 4.2.2 + SEAM201GA

      Hi,
      First of all I am not sure if this is the proper forum to ask this, if it is not please let me know.
      My seam 2.0.1.GA application runs ok in my localhost. But If I try to access it from a different host there is an access problem.
      I have followed the tips provided in this link:


      http://wiki.jboss.org/wiki/Wiki.jsp?page=LimitAccessToCertainClients


      In my case I want to allow acces to IPs 192.168.. and thus in my web.xml I have the following:


      <filter>
              <filter-name>RemoteHostFilter</filter-name>
              <filter-class>org.jboss.remotehostfilter.RemoteHostFilter</filter-class>
              <init-param>        
                  <param-name>allow</param-name>
                  <param-value>192.168.9.*,127.0.0.*</param-value>
              </init-param>
          </filter>    
          
          <filter-mapping>
              <filter-name>RemoteHostFilter</filter-name>
              <servlet-name>Seam Resource Servlet</servlet-name>
          </filter-mapping>
          
          <servlet>
              <servlet-name>Seam Resource Servlet</servlet-name>
              <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
          </servlet>
      



      I have also added the hostfilter.jar in the lib directory.


      After having done all this and deployed and started the server I am not able to acces from a different host, or from my own computer changing localhost for the IP in the url.
      Any help would be really interesting!
      thanks in advance!

        • 1. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA

          I forgot to say that in the web.xml I also have this servlet mapping:



            <servlet-mapping>
                  <servlet-name>Seam Resource Servlet</servlet-name>
                  <url-pattern>/seam/resource/*</url-pattern>
            </servlet-mapping>
          



          thanks in advance!

          • 2. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA
            gbc1

            You could try Subnet-Masking instead if IP-Masking:


            Change 192.168.0.* to 192.168.0.0 for example

            • 3. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA
              msystems

              Are you using the -b 0.0.0.0 parameter when you start JBoss?


              ./run.sh -b 0.0.0.0
              


              • 4. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA

                I have tried your suggestion, but Subnet-Masking hasn´t worked either ;-(
                thanks anyway!

                • 5. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA

                  That was the first thing I tried, but if I start JBoss that way
                  I have the following deployment error:



                  13:32:58,806 ERROR 
                  javax.persistence.PersistenceException: [PersistenceUnit: PRR_SEAM201GA] class o
                  r package not found
                          at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Conf
                  iguration.java:1089)
                          at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Co
                  nfiguration.java:886)
                          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:
                  772)
                          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:
                  183)
                          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:
                  240)
                          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(Hib
                  ernatePersistence.java:120)
                          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
                  java:51)
                          at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFa
                  ctory(EntityManagerFactory.java:85)
                          at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManager
                  Factory.java:50)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                  java:39)
                  ...
                  




                  but that error is not fault of the -b 0.0.0.0 because I have it whenever I run it just with the bat. If I start the server with Netbeans it does not happen and starts ok. I am using Netbeans 6 and have some VM options and other things in the run.conf. Do you know if there is a way of setting that -b 0.0.0.0 in the run.conf?
                  thank you!

                  • 6. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA

                    but that error is not fault of the -b 0.0.0.0 because I have it whenever I run it just with the bat. If I start the server with Netbeans it does not happen and starts ok. I am using Netbeans 6 and have some VM options and other things in the run.conf. Do you know if there is a way of setting that -b 0.0.0.0 in the run.conf?
                    thank you!


                    run.bat -b 0.0.0.0 works just fine.

                    • 7. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA
                      srini.ragu

                      Or else even you can set it as Java System Property as a VM argument


                      -Djboss.bind.address=0.0.0.0


                      or by adding it to the  JAVA_OPTS env variable inside the run.bat

                      • 8. Re: Accesing problem JBOSS 4.2.2 + SEAM201GA

                        After fixing my deployment problems (PersistenceException) running with -b 0.0.0.0 works perfect. Thanks Kenneth and Siarhei.


                        However, if instead of launching the server with -b 0.0.0.0 I do it just with the Djboss.bind.address = 0.0.0.0 assigned to JAVA OPTS it doesn´t work:



                        In that case this is the JBoss Bootstrap Environment



                        ===============================================================================

                          JBoss Bootstrap Environment

                          JBOSS_HOME: C:\jboss-4.2.2.GA\jboss-4.2.2.GA

                          JAVA: C:\Java\jdk1.6.0_01\bin\java

                          JAVA_OPTS:  -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
                        -Djboss.bind.address=0.0.0.0

                          CLASSPATH: C:\Java\jdk1.6.0_01\lib\tools.jar;C:\jboss-4.2.2.GA\jboss-4.2.2.GA\bin\run.jar

                        ===============================================================================


                        And using filters doesn´t work either, at least this way:



                            <listener>
                                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                            </listener>
                           
                            <filter>
                                <filter-name>Seam Filter</filter-name>
                                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
                            </filter>
                           
                            <filter-mapping>
                                <filter-name>Seam Filter</filter-name>
                                <url-pattern>/*</url-pattern>
                            </filter-mapping>
                           
                            <filter>
                                <filter-name>RemoteHostFilter</filter-name>
                                <filter-class>org.jboss.remotehostfilter.RemoteHostFilter</filter-class>
                                <init-param>       
                                    <param-name>allow</param-name>
                                    <param-value>192.168.0.0,127.0.0.0,192.168.0.*</param-value>
                                </init-param>
                            </filter>   
                           
                            <filter-mapping>
                                <filter-name>RemoteHostFilter</filter-name>
                                <servlet-name>Seam Resource Servlet</servlet-name>
                            </filter-mapping>
                           
                            <servlet>
                                <servlet-name>Seam Resource Servlet</servlet-name>
                                <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
                            </servlet>
                         
                            <servlet-mapping>
                                <servlet-name>Seam Resource Servlet</servlet-name>
                                <url-pattern>/seam/resource/*</url-pattern>
                            </servlet-mapping>