Configuration error?

Splash Forums PrettyFaces Users Configuration error?

This topic contains 4 replies, has 2 voices, and was last updated by  Christian Kaltepoth 6 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17931

    RedShadow
    Participant

    I always get the following output:

    SCHWERWIEGEND: WebModule[]PWC1321: Error invoking requestInitialized method on ServletRequestListener com.ocpsoft.pretty.faces.config.PrettyConfigListener

    java.lang.NullPointerException

    at com.sun.faces.application.ServletContextSensitiveSingletonStore.<init>(ServletContextSensitiveSingletonStore.java:83)

    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:92)

    at com.ocpsoft.pretty.faces.util.FacesFactory.getApplication(FacesFactory.java:31)

    at com.ocpsoft.pretty.faces.config.PrettyConfigListener.requestInitialized(PrettyConfigListener.java:34)

    at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:4551)

    at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:626)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

    at java.lang.Thread.run(Thread.java:619)

    I am using Netbeans 7.0, my project is a maven web application. Here is my pom:

    <project xmlns=”http://maven.apache.org/POM/4.0.0&#8243; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd“>

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test</groupId>

    <artifactId>Project</artifactId>

    <version>1.0</version>

    <packaging>war</packaging>

    <name>Project</name>

    <properties>

    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>

    </properties>

    <repositories>

    <repository>

    <id>JBoss</id>

    <name>JBoss Repsitory</name>

    <layout>default</layout>

    <url>http://repository.jboss.org/maven2</url&gt;

    </repository>

    <repository>

    <id>jboss-snapshot</id>

    <url>http://snapshots.jboss.org/maven2</url&gt;

    <releases>

    </releases>

    <snapshots>

    </snapshots>

    </repository>

    <repository>

    <url>http://download.java.net/maven/2/</url&gt;

    <id>hibernate-support</id>

    <layout>default</layout>

    <name>Repository for library Library[hibernate-support]</name>

    </repository>

    </repositories>

    <dependencies>

    <dependency>

    <groupId>log4j</groupId>

    <artifactId>log4j</artifactId>

    <version>1.2.15</version>

    <exclusions>

    <exclusion>

    <groupId>javax.mail</groupId>

    <artifactId>mail</artifactId>

    </exclusion>

    <exclusion>

    <groupId>javax.jms</groupId>

    <artifactId>jms</artifactId>

    </exclusion>

    <exclusion>

    <groupId>com.sun.jdmk</groupId>

    <artifactId>jmxtools</artifactId>

    </exclusion>

    <exclusion>

    <groupId>com.sun.jmx</groupId>

    <artifactId>jmxri</artifactId>

    </exclusion>

    </exclusions>

    </dependency>

    <dependency>

    <groupId>org.hibernate</groupId>

    <artifactId>hibernate-core</artifactId>

    <version>3.3.2.GA</version>

    </dependency>

    <dependency>

    <groupId>org.hibernate</groupId>

    <artifactId>hibernate-annotations</artifactId>

    <version>3.4.0.GA</version>

    </dependency>

    <dependency>

    <groupId>org.hibernate</groupId>

    <artifactId>hibernate-commons-annotations</artifactId>

    <version>3.3.0.ga</version>

    </dependency>

    <dependency>

    <groupId>org.hibernate</groupId>

    <artifactId>hibernate-entitymanager</artifactId>

    <version>3.3.2.GA</version>

    </dependency>

    <dependency>

    <groupId>org.hibernate</groupId>

    <artifactId>hibernate</artifactId>

    <version>3.2.5.ga</version>

    </dependency>

    <dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version>5.0.5</version>

    </dependency>

    <dependency>

    <groupId>com.ocpsoft</groupId>

    <artifactId>prettyfaces-jsf2</artifactId>

    <version>3.2.0</version>

    </dependency>

    <dependency>

    <groupId>javax.sql</groupId>

    <artifactId>jdbc-stdext</artifactId>

    <version>2.0</version>

    </dependency>

    <dependency>

    <groupId>javax.transaction</groupId>

    <artifactId>jta</artifactId>

    <version>1.0.1B</version>

    </dependency>

    <dependency>

    <groupId>javax</groupId>

    <artifactId>javaee-web-api</artifactId>

    <version>6.0</version>

    <scope>provided</scope>

    </dependency>

    <dependency>

    <groupId>junit</groupId>

    <artifactId>junit</artifactId>

    <version>4.8.1</version>

    <scope>test</scope>

    </dependency>

    </dependencies>

    <build>

    <plugins>

    <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-compiler-plugin</artifactId>

    <version>2.3.2</version>

    <configuration>

    <source>1.6</source>

    <target>1.6</target>

    <compilerArguments>

    <endorseddirs>${endorsed.dir}</endorseddirs>

    </compilerArguments>

    </configuration>

    </plugin>

    <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-war-plugin</artifactId>

    <version>2.1</version>

    <configuration>

    <failOnMissingWebXml>false</failOnMissingWebXml>

    </configuration>

    </plugin>

    <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-dependency-plugin</artifactId>

    <version>2.1</version>

    <executions>

    <execution>

    <phase>validate</phase>

    <goals>

    <goal>copy</goal>

    </goals>

    <configuration>

    <outputDirectory>${endorsed.dir}</outputDirectory>

    <silent>true</silent>

    <artifactItems>

    <artifactItem>

    <groupId>javax</groupId>

    <artifactId>javaee-endorsed-api</artifactId>

    <version>6.0</version>

    <type>jar</type>

    </artifactItem>

    </artifactItems>

    </configuration>

    </execution>

    </executions>

    </plugin>

    </plugins>

    <finalName>Project</finalName>

    </build>

    </project>

    web.xml:

    ….

    <filter>

    <filter-name>UrlRewriteFilter</filter-name>

    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>UrlRewriteFilter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    ….

    Before I tried to use PrettyFaces with ant, with no luck. Then I decided to make a new maven project and now I cant get the project to run! Please help me!

    #20948

    This is a known bug of the Mojarra version shipped with Glassfish.

    See here:

    http://code.google.com/p/prettyfaces/issues/detail?id=90

    One of the last comments in this issue describes how to update the Mojarra version to get rid of this problem.

    #20949

    RedShadow
    Participant

    Thanks for he fast answer, I’ll give it a try!

    #20950

    RedShadow
    Participant

    I tried to add these two dependencies in the pom.xml but it is still not working:

    <dependency>

    <groupId>com.sun.faces</groupId>

    <artifactId>jsf-api</artifactId>

    <version>2.1.1-b04</version>

    </dependency>

    <dependency>

    <groupId>com.sun.faces</groupId>

    <artifactId>jsf-impl</artifactId>

    <version>2.1.1-b04</version>

    </dependency>

    Any suggestions how to solve that problem?

    #20951

    Adding the new Mojarra version to your pom won’t work as Glassfish will use its own implementation shipped with the server. You will have to locate the corresponding JAR files in the Glassfish directory and replace them with the new ones. I think they are located in glassfish/modules/ or something like this.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.