[SOLVED] primefaces not working :(

UI Components for JSF
Post Reply
dreamingcloud
Posts: 5
Joined: 20 Apr 2010, 09:49

20 Apr 2010, 10:22

hi guys ^^
I'm using netbeans 6.8, JSF 1.2 and primefaces 1.0.0 (I'm not using richfaces for testing purposes).
So far It didn't work. following is my code
web.xml

Code: Select all

<?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">
    <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>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>org.primefaces.ui.resource.ResourceServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/primefaces_resource/*</url-pattern>
    </servlet-mapping>
    <context-param>
        <param-name>com.sun.faces.allowTextChildren</param-name>
        <param-value>true</param-value>
    </context-param>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/welcomeJSF.jsp</welcome-file>
    </welcome-file-list>
</web-app>
I've read another topic so I changed the url pattern from /primefaces_resources/* to /primefaces_resource/* but it didn't change anything

my jsp page

Code: Select all

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<html>
    <f:view>
        <head>
            <p:resources />
        <head>

        <body>
            <p:editor/>
        </body>
    </f:view>
</html>
the libs that I used:

Code: Select all

commons-logging-1.1.1.jar
jcommon-1.0.0.jar
jstl-1.2.jar
jsf-api.jar
jsf-impl.jar
junit-3.8.jar 
commons-codec-1.4.jar
commons-discovery-0.4.jar
primefaces-1.0.0.jar 
Pleasssssssse help me on this! It's sooo frustrating that it doesn't get to work when it seems so obvious!

dreamingcloud
Posts: 5
Joined: 20 Apr 2010, 09:49

20 Apr 2010, 19:26

here is the source of the test project I tried. If It can help in anyway:
http://rapidshare.com/files/378111559/p ... t.zip.html
MD5: 3627B5FA284C00A6958AE230FDAC2B62

User avatar
Daedalus
Posts: 164
Joined: 28 Jan 2010, 12:03

21 Apr 2010, 09:08

Do you use Tomcat or Glassfish? Wich Version?
PrimeFaces 3.0, Glassfish 3.1.2, Mojarra 2.1.6,

dreamingcloud
Posts: 5
Joined: 20 Apr 2010, 09:49

21 Apr 2010, 09:15

I've used Tomcat 6.0.20 and I tried also running it on 6.0.26

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 Apr 2010, 00:46

What is the error? Any javascript or java exception?

dreamingcloud
Posts: 5
Joined: 20 Apr 2010, 09:49

26 Apr 2010, 11:13

I've checked for java errors. There is none. But when I used firebug for javascript I got:

Code: Select all

 ....loading....
There are no rules in this stylesheet.
<html>
<head>
<link href="/primefacestest/primefaces_resource/1.0.0/yui/menu/assets/skins/sam/menu.css;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/css" rel="stylesheet">
1<html><head><title>Apache Tomcat/6.0.20 - [color=#FF0000]Error report[/color]</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</link>
<link href="/primefacestest/primefaces_resource/1.0.0/yui/assets/skins/sam/button.css;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/css" rel="stylesheet">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</link>
<link href="/primefacestest/primefaces_resource/1.0.0/yui/assets/skins/sam/resize.css;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/css" rel="stylesheet">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</link>
<link href="/primefacestest/primefaces_resource/1.0.0/yui/container/assets/skins/sam/container.css;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/css" rel="stylesheet">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</link>
<link href="/primefacestest/primefaces_resource/1.0.0/yui/editor/assets/skins/sam/editor.css;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/css" rel="stylesheet">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</link>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/utilities/utilities.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/container/container-min.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/menu/menu-min.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/button/button-min.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/editor/editor-min.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/yui/resize/resize-min.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/primefaces/core/core.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
<script src="/primefacestest/primefaces_resource/1.0.0/primefaces/editor/editor.js;jsessionid=149BE6EDD29C9B404276933236DD30B6" type="text/javascript">
1<html><head><title>Apache Tomcat/6.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet Resource Servlet is not available</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet Resource Servlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet Resource Servlet is not available) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.20</h3></body></html>
</script>
</head>
<body>
<script type="text/javascript">
1PrimeFaces.onContentReady('j_id_jsp_1259203854_2', function() {
2j_id_jsp_1259203854_2_widget = new PrimeFaces.widget.Editor('j_id_jsp_1259203854_2:input',{width:'500px',height:'300px',handleSubmit: true});
3j_id_jsp_1259203854_2_widget.render();
4});
</script>
<div id="j_id_jsp_1259203854_2">
<textarea id="j_id_jsp_1259203854_2:input" name="j_id_jsp_1259203854_2:input"></textarea>
</div>
</body>
</html>
To be honest I don't konw what this error means.

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

26 Apr 2010, 17:16

Hi,

can you check your web.xml and correct the resource servlet class as

<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>

with only changing this I can see the good old editor in the page ;)

cheers,
yigit

dreamingcloud
Posts: 5
Joined: 20 Apr 2010, 09:49

26 Apr 2010, 17:39

ohhhhhhhhhhh yeahhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!
thank you! finally it worked! I'm so happpy!
honestly thanks dude :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests