JSF 1.2 Converters in Tomcat 6.0.2
When running the jsf-cardemo web app that comes with JSF 1.2 on Tomcat 6.0.2, I get an exception when loading the customerInfo.jsp page (see below). Not sure if this is an issue with Tomcat or not.
org.apache.jasper.JasperException: /customerInfo.jsp(157,0) Cannot coerce value (creditCardConverter) to type (javax.faces.convert.Converter) for attribute converter.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:406)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:255)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1080)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:818)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Validator.validate(Validator.java:1679)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:413)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:480)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:125)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:133)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
I'd log a bug with the Tomcat folks. This is working fine in GlassFish's JSP implementation.
Similar Messages
-
Turning on logging of JSF 1.2 container inside Tomcat
I have tried to turn on logging for the JSF 1.2 container inside Tomcat 6, but haven't been successful. I followed the steps outlined on Core JavaServer Faces book (p. 634), but the catalina.out file doesn't contain more traces than when logging is not turned on.
I have copied the logging.properties files from jre/lib to Tomcat conf directory. I have set java.util.logging.ConsoleHandler.level=FINEST and I have added a line at end of file (com.sun.faces.level=FINEST) to the logging.properties. I have also set CATALINA_OPTS in catalina.sh to point to the updated logging.properties file in Tomcat conf directory.
I know the logging.properties file gets loaded because when I changed the global log level (.level) to FINEST, catalina.out contained not just INFO level logs but also FINE level logs. However, this logging is not valuable to me because there is way too much information (FINEST for all modules). I would like to selectively turn on logging for JSF.
MartinHave same problem with jsf-impl.jar bundled with facelets-1.1.11
Problem described in facelets FAQ here http://wiki.java.net/bin/view/Projects/FaceletsFAQ -
Exception when access JSF application deployed on apache tomcat
Hi,
hopefully u all will b fine.
I am new in Java Web developement and working on JSF... I made my first hello application of JSF... but when i try to access that from browser, following exception is shown in the browser window... (I am using apache tomcat 5.5.17 and JSF 1.1)
HTTP Status 500 �
type Exception report
message description: The server encountered an internal error () that prevented it from fulfilling this request.
exception :
org.apache.jasper.JasperException: Servlet.init() for servlet Faces Servlet threw exception
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause :
javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jsp.index_jsp._jspService(index_jsp.java:47)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause:
java.lang.NullPointerException
javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jsp.index_jsp._jspService(index_jsp.java:47)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note: The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
I placed the jsp files in "apache-tomcat-5.5.17\webapps\MyProject\"
and web.xml and faces-config file at "apache-tomcat-5.5.17\webapps\MyProject\WEB-INF\"
library files of JSF ("jsf-api.jar", "jsf-impl.jar" and "jstl.jar") at "apache-tomcat-5.5.17\common\lib" also i tried by placing these at "apache-tomcat-5.5.17\webapps\MyProject\WEB-INF\lib"
Please help me out here...
Thanks
ImranMaybe your web.xml is wrong. Doublecheck it.
-
Help needed get JSF final release running on tomcat 5
Hi there,
I know my topic seems to be a easy thing which is often discusseb but I tell you it's not. And after searching the forum an the web... it's driving me crazy I want to make some development and tests but I can' get my stuff running on tomcat 5 and jsf final release.
This is my last error message... seems like tomcat don't know anything about jsf...
my directories---------------------------
my webbapp
-- WEB-INF
classes
lib
scr
web.xml
faces-config.xml
WEB-INF
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
standard.jar
web.xml ------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>MyWeb</display-name>
<description>
FElix
</description>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<!-- ############# Faces Servlet ############# -->
<servlet>
<servlet-name>JavaServer Faces Servlet</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- ############# Mapping ############### -->
<servlet-mapping>
<servlet-name>JavaServer Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>
</web-app>
faces-config.xml---------------------------------
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<from-view-id>/eingabe.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/ausgabe.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>Square</managed-bean-name>
<managed-bean-class>src.com.edu.jsf.bean.SquareBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
ERROR - MESSAGE
org.apache.jasper.JasperException: /eingabe.jsp(19,3) No tag "input_number" defined in tag library imported with prefix "h"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1346)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:258)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
I really stuck so any help is appriciated...
I also tried to put the jars in the common/lib
but still not working...
I tried to get it running with jwsdp ... but same s*** ...
best regards
Felixthanks....
this means... everything was working and I better should have read the notes...
I went back.... installed jwsdp1.3 and everything was fine...
so I will give it a try... change the classes and at this time i use the right tags...
but this will also work for the tomcat downloaded from the apache.org site?
I only need the jar files in the jsf-1.0/lib file and the latest jstl-jars ---
thanks again
reagards felix -
JSF: Problem with checkboxes using Tomcat
Hello,
I m using Java Sun Creator and I�ve noticed a very strange behavior of checkboxes while running my project with Tomcat (I tried 5.5 and 6.0).
On my JSP I have a tabSet component with 3 tabs. the second tab (the first tab in order is selected per default ) displays some boolean values using checkboxes. I set these values using SessionBean properties in an action method that navigates me to the page with the tabSet component. When deploying the application with JSC the values are correct after loading the page and when I select the second tab after that.
When I start the application with Tomcat, the values are correct after loading the page (I�ve checked it displaying the values in a messageGroup), but when I select the second tab, which should show me these selected checkboxes, all of them and even the session bean properties have the value "false" (I see the result in the messageGroup too)?! I had to include my code to the prerender method of the tabSet-page to get the correct values but that has another bad side-effects!
Does anybody have an explanation for this issue?More info,
we add all drivers we use for the different databases we support, in this case we use classes12.jar and postgresql-8.2-504.jdbc3.jar
I just let u know that becouse maybe exists conflicts between these two libraries. Could it be?
thanks -
JSF 1.1 Issue in Tomcat 5.5.9
I have installed my project successfully in Tomcat 6.0 with JDK 1.5.
But when I use jdk 1.4 and tomcat 5.5.9 (Added compatibility jar files for jdk1.4), I am getting following exception.
Feb 9, 2009 5:18:26 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.faces.config.GlassFishConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.GlassFishConfigureListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3617)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Feb 9, 2009 5:18:26 PM org.apache.catalina.core.StandardContext listenerStart.
Please help me to resolve this issue.igatesunidm wrote:
java.lang.ClassNotFoundException: com.sun.faces.config.GlassFishConfigureListenerWhy are you using GlassFishConfigureListener in Tomcat?
Do you understand at all what you´re doing in web.xml and faces-config.xml? -
Problem with JSF 1.2 and Tomcat 6
Hello guys,
I have here:
Tomcat 6.0.10
JSF 1.2_04_b10_p01
I followed these steps without success:
http://forum.java.sun.com/thread.jspa?threadID=787962
http://forum.java.sun.com/thread.jspa?threadID=5156242
Here what I did:
1) Removed the following line in $TOMCAT_HOME/conf/server.xml
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />2) Add the following lines to $TOMCAT_HOME/conf/web.xml
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.apache.el.ExpressionFactoryImpl</param-value>
</context-param>3) Add the following libs to $TOMCAT_HOME/lib
jsf-api.jar
jsf-impl.jar
jstl-1.2.jar
4) Add the following lines to $MYAPP/WEB-INF/web.xml
<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>
<listener>
<listener-class>
com.sun.faces.application.WebappLifecycleListener
</listener-class>
</listener>And here is "the final product":
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context '/protocolo'
10/04/2007 08:18:47 com.sun.faces.config.ConfigureListener registerELResolverAndListenerWithJsp
SEVERE: Error Instantiating ExpressionFactory
java.lang.ClassCastException: org.apache.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:1563)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:419)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)What I need to do? Someone can help me?
Thank you.Thank you for the answer rlubke,
Well this happened because I had compiled the project with the jstl-1.1
The workaround to make jsf 1.2 run on tomcat 6 really works.
But now I have a problem because the JNDI tree in tomcat is read-only ( ro )
and I need to bind a object in the JNDI so an exception happens:
WARNING: Ocorreu um erro inexperado:
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
at org.apache.naming.NamingContext.bind(NamingContext.java:831)
at org.apache.naming.NamingContext.bind(NamingContext.java:171)
at org.apache.naming.NamingContext.bind(NamingContext.java:187)
at org.apache.naming.SelectorContext.bind(SelectorContext.java:171)
at javax.naming.InitialContext.bind(InitialContext.java:400)Here is the code:
try{
Context newContext = new InitialContext();
newContext.bind( dataSourceWrappedID, wrappedDs );
newContext.close();
}catch(NameAlreadyBoundException nabe){
// ok no problem..
}catch(NamingException ne){
if ( log.isWarnEnabled() ){
log.warn("Ocorreu um erro inexperado:", ne);
}You know how to make the JNDI tree in tomcat read-write ?
Thank you a ton. :-) -
Tomcat 5.5 issues, has anyone got JSF working with tomcat 5.5 yet?
Hi,
Firstly I'm wondering if anyone has got JSF 1.1 working with tomcat 5.5 yet.
I'm trying to move from tomcat 5.0.25 to 5.5.4 and my JSF webapps have not liked the move at all.
The classpath doesn't seem to be a problem as I have all the .jars that are required in the classpath of tomcat just like before.
I see the error log in stdout.log (catalina.out on linux) have been reduced to only show the precise error. Or at least is seems at lot easier to read.
My error is simply
SEVERE: Error listenerStart
SEVERE: Context startup failed due to previous errors
I reverted back to using the examples provided like jsf-guessNumber and the car-demo but neither of these will start-up.
This issue seems to have occurred to lots of other people previously but I couldn't find a particular fix or direct compatability issue with tomcat.
Has anyone encountered this before?Back again,
Allright well after a little thought I concluded that this issue had to be some to do with the classpath and the changes between the two tomcat versions.
I had a look at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/RELEASE-NOTES.txt
and noticed that tomcat 5.5 leaves out some important .jar as they are only needed for java 1.4.
-------------------- EXTRACT ------------------------
Installing the compatibility package will add the following to the list, which are
needed when running on J2SE 1.4:
* jmx.jar (Java Management Extensions API 1.2 or later)
* xercesImpl.jar (Xerces XML Parser, version 2.6.2 or later)
--------------------END EXTRACT ------------------------
Therefore I tried putting xercexImpl.jar back onto the tomcat classpath and JSF works once again.
Ah what a relief. -
Error connecting to an EJB 3.0 Remote on OC4J 10.1.3.2 from Tomcat
Hi, I want to connect to a Remote Session Bean running on the OC4J 10.1.3 and it doesn´t work.
I have connected to it from a java standalone application using:
public static void main(String [] args) {
try {
final Context context = getInitialContext();
SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
System.out.println(sessionEJB.mergeEntity(""));
System.out.println( "hola" );
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "passw" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23791/ejb3jar");
return new InitialContext( env );
with this application-client.xml file:
<?xml version = '1.0' encoding = 'windows-1252'?>
<application-client xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<display-name>Model-app-client</display-name>
<ejb-ref>
<ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>ar.com.eds.ejb3.model.SessionEJB</remote>
<ejb-link>SessionEJB</ejb-link>
</ejb-ref>
thats works fine, but when I try to use the same solution from a jsf proyect running on a Tomcat 5.5.20, it fails with this error:
Caused by: java.lang.RuntimeException: Error while creating home.
at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:32)
at ar.com.mcd.fawkes.ui.locator.ServiceLocator$1.get(ServiceLocator.java:12)
at net.sf.opentranquera.web.jsf.locator.ServiceLocatorBean.get(ServiceLocatorBean.java:42)
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
... 80 more
Caused by: javax.naming.NameNotFoundException: Name ejb is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(Unknown Source)
at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:28)
... 87 more
Could you please help me with any tip?
Mauricio
Message was edited by:
MauricioHi, Rick
Thanks for your help.
I deleted de application-client.xml file, added the following lines to the web.xml file:
<ejb-ref>
<ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>ar.com.eds.ejb3.model.SessionEJB</remote>
</ejb-ref>
and now I´m using oracle.j2ee.rmi.RMIInitialContextFactory
there is no error, and it doesn´t throw any exception but the following line returns null.
SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
Its seems the lookup method finds the remote ejb because it doesn´t fail, but it returns null.
Any idea what is wrong?
Mauricio. -
Serious connection pool problem on Tomcat
Hi,
We are deploying our JSF creator-made app onto Tomcat 1.5. We set up our JNDI datasource on Tomcat (using the i-net driver ).
Initially the pages load ok but after a short period of time we are getting these errors:
Initialization Failure: javax.faces.FacesException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool exhaustedWe believe that somehow the Creator-generated code is NOT freeing up connections in the connection pool.
We think that when the afterRenderResponse() methods in the beans call rowset.close() this is NOT returning the connections to the pool. Can someone, hopefully a Sun Engineer confirm that the rowset.close() code in afterRenderResponse() returns the connection behind the rowset to the connection pool.
Could this be a driver issue? We are using the i-net driver not the DataDirect one, but this should implement the full API.
This is a very serious problem for us.
regards,
johndo you have any example code you could post? I have a Spring/JSC tutorial on this forum. Just search for Spring and you should find it. It you need something more, I'll try to give you some help...time provided.
am i
right in thinking that you use the forms designer to
lay out your pages and just put your own stuff in the
bean constructor?Close...but not everything goes in the constructor.
>
One thing that may have caused a problem is we have
just noticed that in one of our most commonly hit
pages this line:
dataTable1Model.setDataCacheKey("com.sun.datacache.my_
page.my_rowset");
featured the WRONG "my_page" jsp page but the correct
rowset name "my_rowset". The page DID load correctly
and run correctly, though. Could this cause problems
with connection pooling? Anyone?I wouldn't think so, but it depends on how Creator builds the code. -
The custm error page is not getting loaded in TomCat 5.0
Hi all,
I am working on a JSF web application deployed in Tomcat 5.0.I was trying to redirect 404 and 500 error pages to custom error pages.But the error pages are not getting loaded and i am getting normal Tocat 404 status page.
I am giving the web.xml entry for the error page defenition.
<error-page>
<error-code>404</error-code>
<location>/faces/displayErrorpage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/faces/SessionExpirepage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/faces/displayErrorpage.jsp</location>
</error-page>
Please help me out to solve this problem.Its urgent.I will be greatful for any kind of help.
Note: The same application working fine,ie,the error page is getting loaded while deploying WAS 6.0.
Jeevan Edakkunnath.That's a specification version. I was asking for the implementation and version. Is it the Sun reference implementation (Sun JSF RI)? If so, which build?
It works flawlessly here on the latest build of Sun JSF RI 1.1, the 1.1_02. You can get the latest build at [http://javaserverfaces.dev.java.net]. I was using Tomcat 6.0.14 by the way, it might make difference.
Does it work if you use plain vanilla JSP files and do not pass the request through the FacesServlet? I recall some bugs related to it, but I am not sure anymore if it is related to the JSF implementation or application server used. -
Hello,
When I was running my JSF application through the embeded Tomcat 6.0.18 server in Netbeans 6.5.1 all worked fine. After deploying the *.WAR file to the stand alone Tomcat 6.0.18 server I get a 404 error when I access the jsf pages. The default page at http://localhost:8080 work fine and so does the servlet in the same webapp as my jsfs. I tried downloading the JSF & JSTL frameworks and placing the contents of their lib directory into TOMCATHOME/lib and restarted the server - no effect
Pls Help ! Thnx
(URL im using to access one of the jsf pages is http://localhost:8080/LUIDManager/LUID_Config_List.jsf)
Here is my web.xml file:
<?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>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</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>
<servlet-name>initServlet</servlet-name>
<servlet-class>Servlets.initServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>initServlet</servlet-name>
<url-pattern>/initServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>forwardToJSF.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/luidregistry</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>Edited by: paulchwd on Apr 15, 2009 5:01 PMThnx for your reply. Not sure what Faclets are. I added the JSF 1.2 framework from Netbeans into my project. I am also an idiot :)
The links the servlet generates to take me to the JSFs had a typo - wrong port #
Thnx for the help -
JSF Deployment error - login.faces not available
I am new to JSF and am having deploying my first example JSF pages in Eclipse on default Tomcat (6.x).
I feel I have done everything stated in the tutorial http://www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html (I did not repeat the step by step instructions in the tutorial - instead, used these instructions to create my own pages / logic). However, I still get the following error:
HTTP Status 404 - /reportwriter/pages/login.faces
type Status report
message /reportwriter/pages/login.faces
description The requested resource (/reportwriter/pages/login.faces) is not available.
Here is my directory structure:
reportwriter
- src
- LoginBean
- LoginServer.java
- Resources.properties
- js
- html
- images
- pages
- login.jsp
- webRoot
- WEB-INF
- lib
- faces-config.xml
- web.xml
- index.jsp with a one line jsp forward to pages/login.faces
here is my faces-config.xml
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<application>
<message-bundle>LoginBean.Resources</message-bundle>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en-us</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<navigation-rule>
<from-view-id>/pages/login.jsp</from-view-id>
<navigation-case>
<description>Handle case for successful login</description>
<from-action>#{loginServer.loginAction}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/pages/task.jsp</to-view-id>
</navigation-case>
<navigation-case>
<description>Handle case for unsuccessful login</description>
<from-action>#{loginServer.loginAction}</from-action>
<from-outcome>failure</from-outcome>
<to-view-id>/pages/failure.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/success.jsp</from-view-id>
<navigation-case>
<from-outcome>return</from-outcome>
<to-view-id>/pages/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/failure.jsp</from-view-id>
<navigation-case>
<from-outcome>return</from-outcome>
<to-view-id>/pages/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>loginServer</managed-bean-name>
<managed-bean-class>LoginBean.LoginServer</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
and here is web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
</web-app>
Can you think what I may be missing here to get the login.faces not available error?
One hint I have is - if I do not set a jsp forward line in the index.jsp file, I get the server deployment for the index.jsp file OK. But not when I have the forward from index.jsp to /pages/login.faces
I also tried setting the context in tomcat server.xml file as follows:
<Context debug="0"
docBase="C:/evsapi/ReportWriter/reportwriter/WebRoot"
path="/LoginBean" reloadable="true"/>
Still no use.
Please help!
Edited by: tipseeker on Dec 1, 2008 3:51 PMtipseeker wrote:
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
I highly recommend your to stop with this and restart with JSF 1.2 instead. JSF 1.0 is legacy and may have still some nasty bugs. You may find this JSF 1.2 / Eclipse 3.4 / Tomcat 6.0 startup tutorial useful as well: [http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html]
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>There's the root cause of the problem, I think. Why did you add this? Are you using JSP or Facelets? This configuration is typical for Facelets, but in your remaining code I only see JSP's being mentioned. -
Hello,
I have a problem with writing JSF 1.2 applications in eclipse. There was no such problem in JSF 1.1. As you know when you are writing in eclipse, if you run again your page with form that you submitted previously on embed tomcat server, no matter what you press on dialog Submit data again, ok or cancel, it is submitted. The Exception is generated in this case:
javax.crypto.BadPaddingException: Given final block not properly paddedBut actually as I understand it has no common with code mistake, it is problem with the cryptation of some session variable. And as this session variable has been changed after restarting tomcat, this cozes an exception to be thrown, I am sure I am not the only one, who have had got this (not in place) exception. And Yeah when I run in firefox I have no problem, everything works just as it has to, but it is difficult to work on applications this way, without console and debug tools.
thanks in advance.I've never seen this problem. What are the exact versions of all the software which you're using?
Maybe you just installed/configured it the wrong way. It might be worth the effort to start over clean using this tutorial: [http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html] -
Using the Oracle ADF Data Visualization Components in a standard JSF enviro
Hi,
I have asked this question on the JDeveloper and ADF forum, haven't gotten a response yet:
Using the Data Visualization Components from ADF in a JBoss 7.1.1
.. but I would like to ask the question here as well if anyone have used the data visualization components from Oracle ADF Essentials .. the free version ... using the graph components in general, but I am looking at specifically using the gantt chart component in particular ... in a standard JSF environment ( e.g. Tomcat + Mojarra, or JBoss with the built-in Mojarra implementation ) ??
I know there are other JSF charting components out there ...like the ones from PrimeFaces, but the gantt chart from ADF looks more ... well .. professional.People are not prone to answer questions that are not really a problem. You want to know something about a free product, install it and see for yourself. In any case spreading your question around is not going to help you, the people who know about ADF are still going to be looking in the ADF forum. If you don't get an answer there, what chance do you think you have that you'll get one here where it is off-topic?
I'll close with a word of advice: you generally pay for quality. If you want professional looking charts, you'll probably have to look at commercial products.
Maybe you are looking for
-
How can servlet return the output as html content with drawing picture?
Does anybody know how can a servlet return the output as html content with drawing picture? The drawing picture is drawn at runtime by the servlet.
-
Problem using external editor in iPhoto
Using Adobe photoshop CS5 the returned image to Iphoto can not be edited with the Iphoto editor. When the image is exported only an elarged section is exported Incorrect export correct export after returned image from photoshop was duplicated in Ipho
-
Which job is taking log Backup of specific database using command?
In my SQL Server there are around 200 jobs of different databases for backup. Which job is taking log Backup of specific database using command? Kindly help. Thanks
-
when i use send to trash it does not go into trash but brings up a message to delete and if I do it is gone forever? is there a cure for this?
-
New MBP won't let me access backups from MyPassport drive
I have a WD MyPassport external drive with an extensive amount of backup data on it. I recently bought a new MBP and while I can access general files on my disk I am not allowed to access my backups. There is a red icon that says I do not have permis