Logging in jsf
I have a jsf application with several pages and backing beans. I am also using a stateless session facade.
How can i use logging in the application?
I plan to use java.util.logging.logger as follows:
public static Logger logger(String loggingResourceName) throws Exception {
//refer Filehandler javadoc
//limit - the maximum number of bytes to write to any one file
//count - the number of files to use
//"%u - a unique number to resolve conflicts
FileHandler fileHandler=new FileHandler("log%u.txt", 500000, 10,true);
//use SimpleFormatter / XMLFormatter
fileHandler.setFormatter(new java.util.logging.SimpleFormatter()) ;
LogManager lm = LogManager.getLogManager();
Logger logger = Logger.getLogger(loggingResourceName);
//Message levels lower than this value will be discarded.
logger.setLevel(Level.INFO);
logger.addHandler(fileHandler);
//register logger
lm.addLogger(logger);
return logger;
Where should i place this method? Backing beans or session facade?
Thanks,
kal
I have figured out how to use the logger. But only problem is, can i use same logger object for logging both web component and the ejb beans? I am using session scope for the backing beans, is there anyway that i can store the logger in the session and use the same for object for all backing beans and also for session facade?
Thanks,
kal
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 -
Some of my JSF actions are not working correctly, and I'd like to enable logging for the faces framework, to be able to see which actions are being called, etc. Is there some way to get faces to write out to a containe rlog file, or even the console? (I'm using Log4J, and the faces JARs are in my WEB-INF/lib directory, if that helps).
thanks,Faces uses the standard java logging facility. You need to configure logging.properties which is in lib directory for the jvm.
-
Hi,
This is velrajan from MindTree consultiong Bangalore India.I am new to JSF.When i try to compile my ActionListerner file i got the following error.
MyActionListener.java:9: package javax.faces.tree does not exist
import javax.faces.tree.Tree;
^
MyActionListener.java:26: cannot resolve symbol
symbol : method getComponentId ()
location: class javax.faces.component.UIComponent
+ component.getComponentId());
^
MyActionListener.java:28: cannot resolve symbol
symbol : method getActionCommand ()
location: class javax.faces.event.ActionEvent
String actionCommand = event.getActionCommand();
^
MyActionListener.java:32: cannot resolve symbol
symbol : class Tree
location: class ch02a.MyActionListener
Tree tree = facesContext.getTree();
^
MyActionListener.java:32: cannot resolve symbol
symbol : method getTree ()
location: class javax.faces.context.FacesContext
Tree tree = facesContext.getTree();
^
MyActionListener.java:45: cannot resolve symbol
symbol : method getComponentId ()
location: class javax.faces.component.UIComponent
System.out.println(component.getComponentId());
^
MyActionListener.java:46: incompatible types
found : java.util.List
required: java.util.Iterator
Iterator children = component.getChildren();
I have the following jar files in my JDK lib folder
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
standard.jar
I hope i have missed out the jsf-ri.jar and jstl_el.jar.
I am not able to find out the jsf-ri.jar in my JSF download.Where can i get this?.
Please suggest me.
This is My Listener:
===============
package ch02a;
import java.util.Iterator;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import javax.faces.event.PhaseId;
import javax.faces.tree.Tree;
public class MyActionListener implements ActionListener {
public PhaseId getPhaseId() {
System.out.println("getPhaseId called");
return PhaseId.APPLY_REQUEST_VALUES;
public void processAction(ActionEvent event) {
System.out.println("processAction called");
// the component that triggered the action event
System.out.println("Before GetComponent");
UIComponent component = event.getComponent();
System.out.println("After GetComponent");
System.out.println(
"The id of the component that fired the action event: "
+ component.getComponentId());
// the action command
String actionCommand = event.getActionCommand();
System.out.println("Action command: " + actionCommand);
FacesContext facesContext = FacesContext.getCurrentInstance();
Tree tree = facesContext.getTree();
UIComponent root = tree.getRoot();
System.out.println("----------- Component Tree -------------");
navigateComponentTree(root, 0);
System.out.println("----------------------------------------");
private void navigateComponentTree(
UIComponent component, int level) {
// indent
for (int i=0; i<level; i++)
System.out.print(" ");
// print component id
System.out.println(component.getComponentId());
Iterator children = component.getChildren();
// navigate children
while (children.hasNext()) {
UIComponent child = (UIComponent) children.next();
navigateComponentTree(child, level + 1);
Please guide me.
Thanks and Regards,
Velrajan T.I'am having the same problem of compiling the MyActionListener class.
Not able to find the jsf-ri.jar in jwsdp-1.6 installation directory also.
Please let me know if any body knows from where to get this jar.
Thanks in Advance -
Tomahawk + Facelets + JSF 1.1 + Tomcat 4.1
When I try to run my server with the latest Tomahawk jar, I get the following exception on server startup:
2006-06-30 08:10:15 org.apache.myfaces.component.html.ext.HtmlDataTable
javax.faces.FacesException: Can't instantiate class: 'org.apache.myfaces.component.html.ext.HtmlDataTable'.
at com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:792)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:372)
at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1088)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:362)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3212)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3554)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)These are the jars I'm including in my library:
antlr-2.7.6rc1.jar
asm.jar
cglib-2.1.3.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
dom4j-1.4.jar
el-api.jar
el-ri.jar
hibernate3.jar
httpunit.jar
itext-1.4.jar
jsf-api.jar
jsf-facelets.jar
JUnit.3.8.1.jar
junitee.1.11.jar
log4j-1.2.13.jar
nekohtml.jar
spring.jar
tomahawk-1.1.3.jar
jsf-impl.jarI've searched google and these forums for any related problems, but have come up short. Does anyone see a problem with my setup? Thanks in advance!Me as well I have the same problem when I tried to use a simple datatable in my JSP
<t:dataTable id="data" var="searchResult" border="1">
<h:column>
<h:outputText value="test" />
</h:column>
</t:dataTable>The libraries I am using are :
common-annotations.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar.jar
standard.jar
tomahawk-1.1.3.jarMy error :
org.apache.jasper.JasperException: Can't instantiate class: 'org.apache.myfaces.component.html.ext.HtmlDataTable'.
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:326)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:132)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:225)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:194)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)I tried some other component of Tomahawk and it works, but I am struggling with the extended datatable.
Thanks,
Paul -
Can't import JSF taglibs?
can't import JSF taglibs?
I'm newbie in JSF
tryig to write simple example from
as result server error
org.apache.jasper.JasperException: An exception occurred processing JSP page /main.jsp at line 4
1: <?xml version="1.0" encoding="UTF-8"?>
2: <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
3: <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
4: <f:view>
5: <html>
6: <head>
7: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> put into WEB-INF/lib:
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
standard.jar
I use:
Tomcat 6.0.2 Tomcat 5.5.9
JDK 1.5 0 07web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 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/web-app_2_4.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.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</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-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config><session-timeout>
30
</session-timeout></session-config><welcome-file-list><welcome-file>
index.jsp
</welcome-file></welcome-file-list></web-app> -
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 -
Hi,
I am working on a migration project to convert my app from websphere 5.1 to wls 10.3.
Now, in doing do I am getting the following JSF error.
java.lang.UnsupportedOperationException at javax.faces.context.FacesContext.getELContext(FacesContext.java:137)
at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:888)
at com.sun.faces.application.ViewHandlerImpl.createView(ViewHandlerImpl.java:328)
at com.supervalu.ris.jsf.misc.RISViewHandler.createView(RISViewHandler.java:107)
Following are my web-inf lib files copied from websphere project.
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
jstl_el.jar
standard.jar
Google search suggested version problem ....but I am not sure.
Can you pls help me?
Edited by: user588655 on Oct 1, 2010 9:34 AMAdd a "weblogic.xml" file inside your application "WEB-INF" directory with the following Tag inside it:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
Please refer to CLASSLOADER FILTERING Feature of weblogic: http://weblogic-wonders.com/weblogic/parsers_issues/ -
My first JSF application stopped responding completely
when I tried to do my first JSF application, the application hangs for
a long time then in the (Command Prompt) I saw this message :
================================================================================
Jul 4, 2005 2:23:41 PM org.apache.catalina.loader.WebappClassLoader
findResourceInternal
INFO: Illegal access : this web application instance has been stopped
already (the eventual
following stack trace is cause by an error thrown for debugging
purposes as well as to
attempt to terminate the thread which caused the illegal access, and
has no functional impact)
================================================================================
My application structure
WEB-INF
web.xml
faces-config.xml
classes
lib
activation.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
standard.jar
index.jsp
================================================================================
the contents of index.jsp is
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head><title>JSP INDEX</title></head>
<body>
<h:form>
<h1>JSP Page</h1>
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this:
index.jsp?sayHello=true&name=Murphy
</h:form>
</body>
</html>
</f:view>
================================================================================
and the content of web.xml is
<?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"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!--
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
-->
<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>*.jsp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
================================================================================
and the content of faces-config.xml is
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
</faces-config>
================================================================================
this is a complete description about the structure of my JSF
application ,,
So, would you please give me your suggestions for this problem
Regardsthank you alot Daniel
the example you gave is working fine
but still my application hangs when I try to run it
and also there is no bean as you noticed
it is so simple
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head><title>JSP INDEX</title></head>
<body>
<h:form>
<h1>JSP Page</h1>
</h:form>
</body>
</html>
</f:view> -
I have created a new web project using JSF 1.2. Currently the jsf-1.2.war present in D:\bea10.3\wlserver_10.3\common\deployable-libraries implements JSF 1.2.05. When I dig into this war file it contains 'glassfish.jsf_1.2.3.2.jar', 'glassfish.jstl_1.2.0.1.jar' and 'javax.jsf_1.2.0.0.jar'
For my project I would like to use the latest version JSF 1.2.12. Is there a possibility to achieve this from worksho p studio.
Sun's latest downloaded version of JSF 1.2.12 has only 'jsf-api.jar' and 'jsf-impl.jar' files.
Any hint on this is highly appreciated.
Thanks.I don't believe you need the JavaServer Pages Standard Tag Library (JSTL) to use JSF, so if you're not using features of the JSTL, don't bother with glassfish.jstl ...
I am using sun's JSF 1.2.12 with Weblogc 10.3 and it works. You need to load the two jars you mention into your web application. The easiest way to do this is by including them in the WEB-INF/lib folder of your web app.
If you don't also include the file WeblogicInjectionProvider.class on your classpath under com/bea/faces you'll get warnings from the server, but they don't seem to break anything.
Note that you also need to include the jars for sun-commons-beanutils, sun-commons-collections, sun-commons-digester and sun-commons-logging for JSF to work. -
HELP with JBoss 4.0.3 and ADF Faces
Hi! I'm trying to deploy a simple web application using ADF Faces. The point is that when trying to access the main page I get the following error:
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
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
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:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
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)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
root cause
java.lang.NullPointerException
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
org.apache.jsp.main_jspx._jspx_meth_f_view_0(org.apache.jsp.main_jspx:99)
org.apache.jsp.main_jspx._jspService(org.apache.jsp.main_jspx:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
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:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
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)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
Apache Tomcat/5.5
I used to get this error time a ago when using MyFaces. It was caused by not getting the page through the Faces Servlet. This time that's not the case. I've got:
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
and I load the page this way: http://localhost:8080/MyApp/faces/main.jspx
Maybe it's because I'm missing some libraries within the war. Next I list the jars I'm incluiding in the archive:
adf-faces-api.jar
adf-faces-impl.jar
adfshare.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging-api.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
Any help would really be appreciated.
Thank you very much.
Joaquín.I suggest that see on JBoss server the list of jndi tree, maybe the entity stay whit another name.
You can go to server administrator page, login on jboss console and find the jndi list. JBoss bring with a mbean that can show the jndi tree of the server, you can use the JMX console of the JBoss to invoke it.
Sorry for my poor english -
Deploying map viewer on tomcat
hello,
because there was no useable result of all the past threads handling this topic, i would like to ask again.
Is there any experience in deploying the Oracle Map Viewer on a Tomcat server?
Sure, it is possible to deploy the ear/war file at Tomcat and to call the main page of Map Viewer (but not completely, at all), but after that, it seems like some parts of the OC4J are missing, like the xml-parser.
I tried something with the jars of oc4j, the classpath of tomcat and so on, but nothing really helped.
And i know about the pro and con of deploying Map Viewer anywhere else than the oc4j or application server. So there is no need to mention this again.
thanks for help
SebastianHi,
I've been running mapvier on tomcat 5.5.15 for a while now, without any problems.
I do that in my dev environment because it's faster to restart. I guess you still need an oracle appserver license even if you run it in tomcat.
Below are the contents of my lib directories:
TOMCAT_HOME/common/lib:
activation.jar
commons-el.jar
jasper-compiler-jdt.jar
jasper-compiler.jar
jasper-runtime.jar
jsp-api.jar
mail.jar
naming-factory-dbcp.jar
naming-factory.jar
naming-resources.jar
ojdbc14.jar
ojdbc14dms.jar
servlet-api.jar
xmlparserv2.jar
and
mapviewerWEB-INF/lib
adf-faces-api.jar
adf-faces-impl.jar
adfshare.jar
chartbuilder.jar
classgen.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
lbs.jar
mapcache.jar
mapviewer.jar
mvclient.jar
mvconsole.jar
mvmbeans.jar
sdoapi.jar
sdogr.jar
sdonm.jar
sdoutl.jar
sdovis.jar
standard.jar
wmsfilter.jar
Also, you have to create the login you will use for the mapviewer admin:
your conf/tomcat-users.xml file should at least contain this:
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="map_admin_role"/>
<user username="yourname" password="secret" roles="map_admin_role,tomcat,admin,manager"/>
Then you use yourname to login to the mapadmin.
This works for me.
Cheers,
Calin -
Mapviewer Configuration on Jdeveloper
Hi,
I have downloaded Mapviewer kit (mapviewer_11ea1.zip) from OTN site. I am trying to develop new web application to render map data stored on oracle spatial using JDeveloper. For now question is where i have to add this mapviewe.ear file into Jdevelpor to get MapViewer bean that is to import oracle.lbs.mapclient.MapViewer. I ma using JDeveloper version 10.1.3
Thanks,
SujnanHi,
I have followed the following steps to develop new mapviewer application.
1) First I downloaded mapviewer_11ea1.zip from otn site.
2) Extracted above file to get mapviewer.ear.
3) Then again i extracted mapviewer.ear file. Now i got the following jar files
adf-faces-api.jar
adf-faces-impl.jar
adfshare.jar
chartbuilder.jar
classgen.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
lbs.jar
mapcache.jar
mapviewer.jar
mvclient.jar
mvconsole.jar
mvmbeans.jar
sdoapi.jar
sdogr.jar
sdonm.jar
sdoutl.jar
sdovis.jar
standard.jar
wmsfilter.jar
4) Then I added these files into my application library.[By right clicking ViewController->Project properties->Library]
5) Copied mapViewerConfig.xml into WEB_INF\conf directory
6) In mapViewerConfig.xml file i have changed the "save_images_at" and "map_data_source" tag
Now my application is working fine
But if I remove this mapViewerConfig.xml then my application would not works. It will throw the excption for mapViewer.addThemesFromBaseMap(strBaseMap); saying that Theme list is not found.
Is these steps are right to develop real time application on oracle spatial and mapviewer?
Thanks,
Sujnan -
Hi All,
I have deployed a ADF application on 10.1.2.0.2 oracle as and I get the following error:
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:758)
at java.util.regex.Matcher.matches(Matcher.java:388)
at oracle.adfinternal.view.faces.webapp.DispatchServletResponse.setContentType(DispatchServletResponse.java:31)
at oracle.adf.view.faces.webapp.ResourceServlet._setHeaders(ResourceServlet.java:393)
at oracle.adf.view.faces.webapp.ResourceServlet.doGet(ResourceServlet.java:178)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:748)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at oracle.adf.view.faces.webapp.ResourceServlet.service(ResourceServlet.java:135)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
I do not get the error when I am deploying the EAR file to 10.1.3.1 version of Oracle AS.
1) I did check in my JSP page that I am setting the content-type as the page attribute.
Any help will be really appreciated.
Thanks,
-RaamThank for the information Shay,
I ran the installer script and it looks like it did everything right, copied the files in the right locations and changed the application.xml for the libraries. But still I get the same exception.
Here is the list of files I have in my WEB-INF/lib directory for my web-module. I am deploying the same EAR file that works in 10.1.3 vesion:
adf-faces-api.jar
commons-collections.jar
commons-logging.jar
jsf-api.jar
saxpath.jar
xalan.jar
adf-faces-impl.jar
commons-digester.jar
jaxen-full.jar
jsf-impl.jar
standard.jar
xercesImpl.jar
commons-beanutils.jar
commons-logging-api.jar
jdbc2_0-stdext.jar
jstl.jar
trilead-ssh2-build213.jar
xml-apis.jar
Do you think any of the JARs above might be causing the problem? I think I am close but not there yet. Should be an easy one!!
-Raam -
Just give me a paragraph!
The more I try to work with JSF (I'm trying to do things the JSF way, really, I am!), the more JSF doesn't want to work with me for simple things.
Let's just say I want to show the equivalent of the following HTML, but only if the user isn't logged in:
<p class="info"><a href="login.html">Log in</a> to see more data.</p>Simple, huh? Now, how do I do that in JSF? About the best I can do in JSF is this atrocious verbosity:
<html:panelGroup rendered="#{!user.loggedIn}">
<jsf:verbatim><p class="info"></jsf:verbatim>
<html:commandLink action="login">
<jsf:verbatim>Log in</jsf:verbatim>
</html:commandLink>
<html:outputText value=" to see more data."/>
<jsf:verbatim></p></jsf:verbatim>
</html:panelGroup>I have to create a <html:panelGroup> because there's no JSF <p> component (to my knowledge).
I have to use the nested verbatim because I want to conditionally show the <p> tags along with the content. But in my XML source file, <jsf:verbatim> won't allow a nested beginning tags without ending tags, so I have to XML-escape my beginning <p> tag.
The nested <jsf:verbatim> inside <html:commandLink> certainly makes all this hard to internationalize, but I can live with that---it gets worse, though.
Outside <html:commandLink>, I have to use <html:outputText> because <jsf:verbatim>, because the latter trims off the beginning whitespace. However, I can't put the ending </p> tag literally here because the attribute can't have the less-than character ('<'). If I XML-escape the character, it comes out in the resulting file as escaped, and my XML is well-formed. So I have to put the extra <jsf:verbatim>.
Who knew a simple paragraph would take up so much of my time just to research how to do it in JSF? Now I'm taking more time researching whether it can be done better. Any suggestions? (I know, I can write a JSF <p> component...)Why on earth didn't JSF provide this [HTML] functionality
with the reference implementation? I know Sun can't
provide everything, HTML equivalents are really
basic, and aren't rocket science.After more thinking and jumping into hard-core custom component development, I'm having some new thoughts---I'm understanding more the JSF architecural principles. This leads me to think that something like Sergey's very useful htmLib should not be included in the JSF API. Here's why.
First, I'm beginning to see where Hans Bergsten is coming from, when he recommends "Improving JSF by Dumping JSP" ( http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html ). I'm not quite ready to dump JSP, but the tight integration of JSF with JSP obscures the "JSF way" and makes it difficult for newcomers to adjust to its different paradigm.
Let me make an analogy with the Resource Description Framework (RDF) ( http://www.w3.org/RDF/ )---many newcomers have an extremely hard time understanding why RDF is useful or even different, because almost every discussion assumes that RDF is going to be serialized in XML. This in itself isn't so bad, but it leads newcomers to think of RDF as just another XML vocabulary. It's not. RDF is really an abstract framework for describing resources, resource properties, and the values of those properties (which can be other resources)---a framework for creating ontologies that, as some AI pundits would assert, can describe the world itself. XML provides a convenient syntax for serializing a directed graph of an RDF data model, but it produces no different semantics than limitless other syntaxes that could be invented and used to serialize RDF. (A Java properties file is one possible example that could produce a semantically identical RDF data model as could an XML serialization.)
Similarly, JSF is not just a way to write out HTML tags. It's actually a hierarchy of components that replicate the semantics of various data models and their interaction with a user. JSP is just one vehicle to do that; maybe it's not even the best. Maybe JSF is too closely tied to JSP, obscuring this revelation from users.
In this light, Sergey's HTML components have no place in the standard JSF API, because they function merely as a way for new users to quickly get a JSP page to write out a <p>, or a <ul>, or even a <table>. Sergey acknowledges as much: "The library allows you to use old-fashioned HTML layout tags ...., easing the transition to JSF for newbies." ( http://jsftutorials.net/htmLib/ )But the "JSF way" is to think in terms of JSF components implementing data models---whether they spit out XHTML or WAP or SGML is the responsibility of a plugable renderer, and should be distinct from the way the data is stored. htmLib is handy for newcomers and helpful when stuck in a bind and need to get a JSP generated, but designers creating large-scale, elegant JSF application architectures should be weaned away from thinking in terms of brute-force HTML tag writing.
My modification of viewpoint doesn't let JSF off the hook---indeed JSF should provide functionality out-of-the-box that, some way or another, can generate all desirable HTML tags. Instead of shallow wrapping classes, however, they should be robust, capable data model components with comprehensive default HTML renderers. Currently the dataTable component is about the only JSF component that provides a shadow of this concept, and in my opinion dataTable only allows about 70%-85% of needed functionality.
Take HTML <dl> (definition list) for an example. htmLib provides a great way for newcomers to write out an HTML definition list, and provides a teaching tool for learning component creation. The JSF standard component library, however, should provide a definitionList component that descends from UIData, allowing the component to be data-aware. A user should think in terms of an actual list model containing definitions. The definitionList should provide UIColumn descendants for "term" and "definition", and maybe even other columns. The default renderer for HTML would render a <dl> element, with <dt> for each term column child and a <dd> for each definition column child. (After a day of exploring custom component creation, I've just implemented such an animal as I've described.)
In the end, the functionality of such a definitionList with its default renderer is equivalent to htmLib:dl, but the semantics are different: an actual data model is described, and different renderers can be plugged in for other markup types.
Similarly, there should be some sort of text block data model with nestable children. There should either be a different UIComponent class for <p>, <blockquote>, and the like, or the component should indicate its semantics with, say, a semantics="paragraph" or semantics="blockquote" attribute.
In summary, Sergey's components are wonderful and very useful. I'm slowly coming around to the "JSF way," however, which leads me to conclude that, although JSF may need a paragraph data model component with a default HTML renderer, it doesn't need and shouldn't have a pass-through HTML <p> tag-writer such as htmLib provides. The difference is subtle, but paradigmatic.
Cheers,
Garret
Maybe you are looking for
-
Adobe Acrobat 9 Standard is still seeing my old scanner install. How to force it to see new scanner install? Scanner is recognized by and works fine in Windows. Acrobat however still sees Fujitsu fi-6130dj #3. I need it to see Fujitsu fi-6130dj w
-
Hi All, I am using the Room Templates "SAP_Information_Site" and "SAP_Meeting_Room_Extended" for creating collaboration rooms. My requirement is can I create a room merging these two templates? I want a new room having all the features of above menti
-
Hi , Recently i faces one issue :- schema backup from one database is created for <SCHEMA1> whose default tablespace is <TABS1> , and trying to import in to <SCHEMA1> of different database whose default tablespace is <TABS2> but it looks for <TABS1>
-
Cant insert media into dreamweaver keep getting an error message
Whats going on forum, I've trying to insert sound into dreamweaver from a track that i made in garageband. I keep getting an error message saying the kind of plugin cannot be found
-
LR direct to CS details: can we avoid preferences pane?
Develop>Photo>Edit in: Is there a way to select file format, color space, bit depth, resolution at this point rather than preferences? Preferences is a very annoying route when you gotta change this every time for going to a photoshop operation from