4 Replies Latest reply on Sep 30, 2009 11:29 PM by chris.simons

    Problems running Seam on oracle weblogic 11g

    derkd

      Hi all,


      Finally I got rid of OC4j and got the new Oracle Weblogic 11g so I could use the newest Seam, RichFaces and JSF 1.2.
      Unfortunatly I'm not able to get Seam running on weblogic 11g, struggeling with it for more than a week now. I followed the seam reference guide chapter http://docs.jboss.com/seam/2.2.0.GA/reference/en-US/html/weblogic.html and installed the JSF library into weblogic.


      I'm now at a point where I can see the example page. When I navigate to the login screen and enter admin and click on login, it throws an error in the console.
      It can't find the authenticator:



      javax.el.PropertyNotFoundException: Target Unreachable, identifier 'authenticator' resolved to null



      So it looks like it's not finding the seam components which are in my jar. When checking the debug.seam I can't find the Authenticator component so it really doesn't exists.
      Is it because I defined my jar as just a jar and should have defined it as an ejb type? Or does that have nothing to do with it?
      Does anyone have a clue?


      I'm building with Maven2.
      This is how my configuration looks like, if you need more info please let me know:


      main pom:



      <project xmlns="http://maven.apache.org/POM/4.0.0" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
           <modelVersion>4.0.0</modelVersion>
           <groupId>example-test</groupId>
           <artifactId>test-webapplication</artifactId>
           <packaging>pom</packaging>
           <version>${applicationVersion}</version>
           <name>test-webapplication parent project</name>
           <properties>
                   <applicationVersion>1.0.0</applicationVersion>
               <seam.version>2.2.0.GA</seam.version>
         </properties>
           
           <parent>
            <groupId>org.jboss.seam</groupId>
                <artifactId>root</artifactId>
            <version>2.2.0.GA</version>
          </parent>
         <dependencies>
             <dependency>
               <groupId>org.jboss.seam</groupId>
               <artifactId>jboss-seam</artifactId>
               <version>${seam.version}</version> 
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>javax.faces</groupId>
               <artifactId>jsf-api</artifactId>
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-entitymanager</artifactId>
               <!--<version>3.4.0.GA</version>-->
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-validator</artifactId>
               <!--<version>3.1.0.GA</version>-->
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>javax.servlet</groupId>
               <artifactId>servlet-api</artifactId>
               <!--<version>2.5</version>-->
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>javax.servlet.jsp</groupId>
               <artifactId>jsp-api</artifactId>
               <!--<version>2.1</version>-->
               <scope>provided</scope>
             </dependency>
             <dependency>
               <groupId>log4j</groupId>
               <artifactId>log4j</artifactId>
               <scope>provided</scope>
             </dependency>
        </dependencies>
      
           <modules>
                <module>jar</module>
                <module>web</module>
                <module>ear</module>
           </modules>
      
           <build>
                <defaultGoal>package</defaultGoal>
                <plugins>
                     <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-compiler-plugin</artifactId>
                          <configuration>
                               <source>1.5</source>
                               <target>1.5</target>
                          </configuration>
                     </plugin>
      
                </plugins>
           </build>
      </project>





      my ear pom:




      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
           <parent>
                <groupId>example-test</groupId>
                <artifactId>test-webapplication</artifactId>
                <version>${applicationVersion}</version>
           </parent>
           <modelVersion>4.0.0</modelVersion>
           <groupId>example-test</groupId>
           <artifactId>test-webapplication-ear</artifactId>
           <name>test-webapplication-ear</name>
           <packaging>ear</packaging>
      
           <dependencies>
                <dependency>
                     <groupId>${project.parent.groupId}</groupId>
                     <artifactId>${project.parent.artifactId}-jar</artifactId>
                     <version>${project.parent.version}</version>
                     <type>jar</type>
                </dependency>
      
                <dependency>
                     <groupId>${project.parent.groupId}</groupId>
                     <artifactId>${project.parent.artifactId}-web</artifactId>
                     <version>${project.parent.version}</version>
                     <type>war</type>
                </dependency>
      
                <dependency>
                     <groupId>org.jboss.seam</groupId>
                     <artifactId>jboss-seam</artifactId>
                     <type>ejb</type>
                     <!--<type>ejb</type> won't work in weblogic but it should be :( -->
                     <exclusions>
                          <exclusion>
                               <groupId>javax.el</groupId>
                               <artifactId>el-api</artifactId>
                          </exclusion>
                     </exclusions>
                </dependency>
                <dependency>
                     <groupId>org.jboss.el</groupId>
                     <artifactId>jboss-el</artifactId>
                     <version>1.0_02.CR4</version>
                     <type>jar</type>
                     <exclusions>
                          <exclusion>
                               <groupId>javax.el</groupId>
                               <artifactId>el-api</artifactId>
                          </exclusion>
                     </exclusions>
                </dependency>
          <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-api</artifactId>
          </dependency>
          <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-impl</artifactId>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-ui</artifactId>
            <scope>provided</scope>
          </dependency>
          <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-validator</artifactId>
             <scope>compile</scope>
           </dependency>
      
          
          <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </dependency>
          <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.8.1</version>
          </dependency>
          <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
          </dependency>
          <dependency>
            <groupId>oswego-concurrent</groupId>
            <artifactId>concurrent</artifactId>
          </dependency>
          <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-ri</artifactId>
            <version>1.2</version>
          </dependency>
      
           </dependencies>
      
           <build>
                <!--<finalName>test-webapplication</finalName>-->
                <plugins>
                     <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-ear-plugin</artifactId>
                          <configuration>
                          <!--<defaultJavaBundleDir>APP-INF/lib</defaultJavaBundleDir>-->
                          <defaultLibBundleDir>lib</defaultLibBundleDir>
                          <generateApplicationXml>true</generateApplicationXml>
                               <modules>
                                    <jarModule>
                                         <groupId>org.jboss.el</groupId>
                                         <artifactId>jboss-el</artifactId>
                                         <includeInApplicationXml>true</includeInApplicationXml>
                                    </jarModule>                                                            
                                    <webModule>
                                         <groupId>example-test</groupId>
                                         <artifactId>test-webapplication-web</artifactId>
                                         <contextRoot>test-webapplication-web</contextRoot>
                                    </webModule>
                               </modules>
                               <resourceDir></resourceDir>
                          </configuration>
                     </plugin>
                </plugins>
           </build>
      </project>



      jar pom:



      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
           <parent>
                <groupId>example-test</groupId>
                <artifactId>test-webapplication</artifactId>
                <version>${applicationVersion}</version>
           </parent>
           <modelVersion>4.0.0</modelVersion>
           <groupId>example-test</groupId>
           <artifactId>test-webapplication-jar</artifactId>
           <name>test-webapplication-jar</name>     
           <packaging>jar</packaging>
           <dependencies>          
               <dependency>
                  <groupId>org.jboss.seam</groupId>
                  <artifactId>jboss-seam</artifactId>
                  <version>${seam.version}</version>
                  <scope>provided</scope>
                </dependency>
               <dependency>
                  <groupId>javax.faces</groupId>
                  <artifactId>jsf-api</artifactId>
                  <scope>provided</scope>
                </dependency>          
                <dependency>
                  <groupId>javax.faces</groupId>
                  <artifactId>jsf-impl</artifactId>
                  <scope>provided</scope>
                </dependency>
                
                <dependency>
                 <groupId>javax.servlet</groupId>
                 <artifactId>servlet-api</artifactId>
                 <!-- <version>2.5</version>-->
                 <scope>provided</scope>
               </dependency>
               
               <dependency>
                 <groupId>org.richfaces.framework</groupId>
                 <artifactId>richfaces-api</artifactId>
               </dependency>
               <dependency>
                 <groupId>org.richfaces.framework</groupId>
                 <artifactId>richfaces-impl</artifactId>
                 <scope>provided</scope>
               </dependency>
               <dependency>
                 <groupId>org.richfaces.ui</groupId>
                 <artifactId>richfaces-ui</artifactId>
                 <scope>provided</scope>
               </dependency>
               
               <dependency>
                  <groupId>junit</groupId>
                   <artifactId>junit</artifactId>
                 <version>4.4</version>
                 <scope>test</scope>
               </dependency>
          </dependencies>
       
          
          <build>
               <resources>
                    <resource>
                       <filtering>false</filtering>
                       <directory>${basedir}/src/main/resources</directory>
                       <includes>
                          <include>META-INF/ejb-jar.xml</include>
                          <include>properties/messages.properties</include>
                          <include>properties/seam.properties</include>
                          <include>properties/components.properties</include>
                       </includes>
                    </resource>
               </resources>
            <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- best lock down version of the plugin too -->
                <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
                </configuration>
                </plugin> 
             </plugins>
           </build>
      
          
      </project>



      web pom:




      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
           <parent>
                <groupId>example-test</groupId>
                <artifactId>test-webapplication</artifactId>
                <version>${applicationVersion}</version>
           </parent>
           <modelVersion>4.0.0</modelVersion>
           <groupId>example-test</groupId>
           <artifactId>test-webapplication-web</artifactId>
           <name>test-webapplication-web</name>
           
           <packaging>war</packaging>
      
           <dependencies>
           <dependency>
             <groupId>example-test</groupId>
             <artifactId>test-webapplication-jar</artifactId>
             <version>${applicationVersion}</version>
            <scope>provided</scope>
             <type>jar</type>
           </dependency>
      
      
           <!-- The following 4 dependencies are included in the WEB-INF/lib of the war -->
          <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam-ui</artifactId>
            <exclusions>
             <exclusion>
               <groupId>org.jboss.seam</groupId>
               <artifactId>jboss-seam</artifactId>
             </exclusion>
             <exclusion>
               <groupId>commons-collections</groupId>
               <artifactId>commons-collections</artifactId>
             </exclusion>
                <exclusion>
               <groupId>commons-beanutils</groupId>
               <artifactId>commons-beanutils</artifactId>
             </exclusion>
           </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam-debug</artifactId>
            <exclusions>
             <exclusion>
               <groupId>org.jboss.seam</groupId>
               <artifactId>jboss-seam</artifactId>
             </exclusion>
           </exclusions>
          </dependency>
          <dependency>
           <groupId>com.sun.facelets</groupId>
           <artifactId>jsf-facelets</artifactId>
         </dependency>
          
      
          <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-api</artifactId>
            <exclusions>
              <exclusion>
                <groupId>commons-beanutils</groupId>
                  <artifactId>commons-beanutils</artifactId>          
              </exclusion>
            </exclusions>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-impl</artifactId>
            <exclusions>
              <exclusion>
                <groupId>commons-digester</groupId>
                  <artifactId>commons-digester</artifactId>          
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-ui</artifactId>
          </dependency>
      
           </dependencies>     
           
           
      </project>





      components.xml
      
      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
      
        <core:init debug="false" jndi-pattern="\#{ejbName}/local"/>
           
        <core:manager concurrent-request-timeout="500"
                       conversation-timeout="120000"
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>
      
         <web:hot-deploy-filter url-pattern="*.seam"/>
      
         <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
      
         <event type="org.jboss.seam.security.notLoggedIn">
            <action execute="#{redirect.captureCurrentView}"/>
         </event>
         <event type="org.jboss.seam.security.loginSuccessful">
            <action execute="#{redirect.returnToCapturedView}"/>
         </event>
      
         <mail:mail-session host="localhost" port="2525" username="test" password="test" />
      
      
      </components>



      web.xml:




      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
           <context-param>
                <param-name>org.richfaces.SKIN</param-name>
                <param-value>wine</param-value>
           </context-param>
      
           <!-- Seam -->
           <listener>
                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
           
           <!-- Because the jsf-impl.jar  is not in the WAR this listener need to be configured -->
           <listener>
            <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
          </listener>
      
           <servlet>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
           </servlet>
      
           <servlet-mapping>
                <servlet-name>Seam Resource Servlet</servlet-name>
                <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
      
           <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>
      
           <!-- JSF -->
           
           <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>client</param-value>
          </context-param>
            <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
           </context-param>
           <context-param>
                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>true</param-value>
           </context-param>
           <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>
           <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.seam</url-pattern>
           </servlet-mapping>
           <session-config>
                <session-timeout>30</session-timeout>
           </session-config>
      
           <welcome-file-list>
                <welcome-file>index.html</welcome-file>
           </welcome-file-list>
      
           
      </web-app>







        • 1. Re: Problems running Seam on oracle weblogic 11g
          derkd

          Ahhhh I just found the error myself...


          in the jar pom I add some resources:




                          <resource>
                           <filtering>false</filtering>
                           <directory>${basedir}/src/main/resources</directory>
                           <includes>
                              <include>META-INF/ejb-jar.xml</include>
                              <include>properties/messages.properties</include>
                              <include>properties/seam.properties</include>
                              <include>properties/components.properties</include>
                           </includes>
                        </resource>




          This should be changed in this:




                  <resource>
                           <filtering>false</filtering>
                           <directory>${basedir}/src/main/resources</directory>
                           <includes>
                              <include>META-INF/ejb-jar.xml</include>
                           </includes>
                        </resource>
                        <resource>
                          <filtering>false</filtering>
                          <directory>${basedir}/src/main/resources/properties</directory>
                          <includes>
                            <include>*.properties</include>
                          </includes>
                        </resource>
                   </resources>



          It couldn't find the seam.properties and other properties files because it copied them in the META-INF/properties and it needed to be in the root of the jar.
          Now it works!

          • 2. Re: Problems running Seam on oracle weblogic 11g

            Congratulations getting the example setup.


            Have you gone any deeper into your Seam / Weblogic integration?  Specifically, have you had to switch out the logging component from JDK to log4j?  I'm not getting any Hibernate output during application deployment; I'm wondering if you've run into the same issue.


            Thanks.

            • 3. Re: Problems running Seam on oracle weblogic 11g
              rafaelubaldojr

              I have some projects I want to migrate from ADF to SEAM (RichFaces or IceFaces). I have limited experience with Seam. My customers run primary Oracle databases and Web Logic (for now).


              Given the stack:


              - Yes, we know. ADF rocks. Or so our Oracle sales rep says as we cut him a million dollar check for Web Logic.


              - How problematic is running Seam on WebLogic 11? I see Derk has the project up and running but are their any samples out there to get up and running?


              - We are undecided as to use Hibernate over TopLink. From my reading Seam seems to optimized for Hibernate. But when working with an Oracle backend TopLink has a lot of features to be missed. I would be interested to hear from those out there who out there currently using TopLink with Seam(?). And what are the opinions and advice for straying from Hibernate? How problematic is it to configure TopLink and are there examples available?


              Thanks in advance




              • 4. Re: Problems running Seam on oracle weblogic 11g

                I finally finished migrating our Seam 2.x project from JBoss to WebLogic 11.  I can assure you that it is possible, but certainly not without difficulties.


                It took me about three months of serious trial and error (setting up Hibernate/JPA, modifying some session beans to Java EE spec, diagnosing error messages, configuring logging, among many others).


                Part of our problem was that our application was originally generated from seam-gen way back in the Seam 1.1 days, and therefore was a full version behind the preferred EAR deployment structure that comes recommended with Seam 2.x.


                Converting from ADF to RichFaces sounds like it'll be your biggest problem.


                I'm not familiar on TopLink and WebLogic; remember that WebLogic was not always an Oracle product, so you can't let the brand confuse you.  By default, WebLogic works out of the box with OpenJPA, but we configured it to use Hibernate/JPA.