Ryan Lubke

Ranch Hand
+ Follow
since Jun 20, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Lubke

Originally posted by Aditi khare:
I am trying to test run a simple Servlet on Application Server 9.1 , I am getting Java.lang.Runtime exception and java.lang.reflect.InvocationTargetException
The log details are as follow, please help!
Caused by: java.lang.reflect.InvocationTargetException
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:597)
at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:421)
at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:343)
... 48 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.tools.admingui.util.TargetUtil.getAssociatedVS(TargetUtil.java:109)
at com.sun.enterprise.tools.admingui.handlers.ApplicationHandlers.getApplicationInfo(ApplicationHandlers.java:173)
... 54 more

You should post this to the GlassFish forums.
13 years ago
This was cross-posted in the sun forums. I've already answered there.

Originally posted by Piotr Cierny:
I have created a simple application that uses 2 languages - english and polish. I want to set locale with html link for myfaces and jstl tags.
The problem is that when i press the link, it only changes the messages outputed by jsf tags. The jstl messages remain unchanged.
The locale is changing (checked with c:out) but messages aren`t.
The funniest thing happends when i change language to english and check the chceckbox - All messages change to english and the jstl locale variable is emptied (c:out doesn`t write anything out).

This example worked with jsf1.1.5 but it doesn`t work with jsf 1.2.
Can any one tell me why??

I enclose the code of this example:



I`ve tried to download new jstl.jar and standard.jar, add tlds and declarations in web.xml but it didn`t help.

If anyone knows answer to this mystery please help.

13 years ago

Originally posted by pinky suresh:
Sorry for previous incomplete reply...

I have servlet-api.jar in commons/lib and still i am getting the NoClassDefFoundError for ServletRequest.

Please let me know what i am missing.

Might try following up with the tomcat folks. Something seems wrong with your installation now.
13 years ago

Originally posted by M Burke:
I am new to faces. I want to build a table from a collection of objects, and make a link for each to open that item on a different form.

In the past, I added request parameters to my links to know which one is clicked. Like this: a href='view.jsp?row=1&col=1' then do a request.getParameter('row') in my servlet.

How do I do this equivalant in JSF? I can't even find any examples of a faces action even accessing the request object.

I'd recommend going through these tutorials: http://balusc.blogspot.com/2006/06/using-datatables.html
13 years ago

Originally posted by Alex Horst:
Is it possible to access the <body> element from a managed bean?
I want to add the "onLoad" attribute programmatically.

The statement above returns null. I guess this is because the ViewRoot contains JSF-Components only?

Thanks in advance.

In short yes. If you want to have access to the 'head' then you need a head component. It would be simple to write one, though component libraries such as woodstock [1] have a head component.

Additionally, JSF 2.0, there will be a basic head component included.

[1] https://woodstock.dev.java.net
13 years ago
I'd ensure that there are no other instances of jsf-impl within the tomcat installation (i.e. server/lib or common/lib).
13 years ago

Originally posted by Gaurav Ram:

I want to use JSF 1.2 @PostConstruct annotation and for that i have downloaded latest version of JSF i.e. JSF 1.2 and also i configured Tomcat 6.x.x in my MyEclipse, but when i am using @PostConstruct in Bean it is giving compile time error,, it is not recognizing that package,,, can you please help me out...What i am missing???


You need to include the common-annotations jar in your compilation classpath. You'll also want to include said JAR with your application,
otherwise you'll have runtime issues.

Also, when posting versions, JSF 1.2 is a spec version. There are two common implementations of the specification in the wild right now. It's useful to include which implementation and version.
13 years ago

Originally posted by Cameron Wallace McKenzie:
Indeed...I was looking at the phase listener.

I guess you could achieve something similar with a ServletListener configured on the FacesServlet.

Looks like we're not the only ones hitting this conundrum. Seems JSF 1.2 has a solution, developed by people better looking than you and me.

Post on Best Practices for JSF Backing Beans / Managed Beans

Unfortunately, I'm deploying to Rational Application Developer, and IBM has a policy of not supporting new standards until they are extremely old.

-Cameron McKenzie

If using JSF 1.2, look at the beforePhase and afterPhase attributes provided.

13 years ago

Originally posted by Ketan Jambhekar:
Refer to the discussion in the following link


NOTE: f:verbatim isn't necessary if using JSF 1.2 in combination with JSP 2.1.
13 years ago

Originally posted by Joseph Sweet:

In your scenario, what if I were in Page B prior to my visit in Page A? Then When I come back to Page B, this page has no state, because no state of no page is saved on the session (i.e., on the server).
But when I was in Page B on the 1st time, I did change its state to be different than its default state. So where was it saved in your algorithm?

When you change the state of PageB, then the state change will be present in the saved state of PageB. The saved state of one page has no impact on the saved state of another page.

I'd like to recommend you spend some time reading the specification if state saving is of interest to you.
13 years ago
Actually, you're not.

The state for PageA will be valid only for PageA.
When you submit the form, the state is used to reconstruct
PageA, apply the form data, and then navigate to PageB.
PageB's hidden field will only contain data relevant to PageB.
13 years ago

Originally posted by Tim Holloway:
I don't think that these are part of JSF - they're part of the JSR-250 lifecycle spec.

Spring supports these annotations, I believe.

The JSF 1.2 spec requires support of these annotations in a Java EE 5 environment. That said Mojarra (the RI) supports these two annotations
outside of an EE environment if the annotations are present in the classpath.

As to their explanation, it's pretty straight forward.
Methods marked with the @PostConstruct annotation will be invoked after the bean has been created, any resources have been injected, and any managed properties set, but *before* the bean is actually pushed into scope.

Methods marked with @PreDestroy will be called before the bean has been
removed from scope.

This blog has some examples -> http://weblogs.java.net/blog/jhook/archive/2007/05/jsf_12_ri_backi.html
[ January 22, 2008: Message edited by: Ryan Lubke ]
13 years ago

Originally posted by Tim Holloway:
It looks like your WAR is missing an XML DOM library used by the Sun JSF code.

The JAXP implementation in JDK 1.5 and above will work fine with the RI. That said, older implementations of Tomcat provided their own JAXP implementation and overrode the JDK. If this is one of those Tomcat versions, then overriding the JDK's jaxp is going to cause failures.
13 years ago
I'd recommend posting the JBoss forums. Hard to tell what's going wrong in all that mess.
13 years ago

Originally posted by Ravindranath Chowdary:
Hi Ranchers,
I am encountering the following error when I try to integrate Struts with JSF. I am using jdk1.5.0_10 and Tomcat 5.0 and Eclipse 3.1.


2007-12-06 16:11:25 StandardContext[/poeticWeb]Exception sending context initialized event to listener instance of class org.apache.struts.faces.taglib.LifecycleListener
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:267)

2007-12-06 16:11:25 StandardContext[/poeticWeb]Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.NoSuchMethodError: org.w3c.dom.Node.getTextContent()Ljava/lang/String;
at com.sun.faces.config.processor.AbstractConfigProcessor.getNodeText(AbstractConfigProcessor.java:126)
at com.sun.faces.config.processor.FactoryConfigProcessor.processFactories(FactoryConfigProcessor.java:148)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:125)

After I start the Tomcat I am getting the following error:

Dec 6, 2007 7:27:14 PM org.apache.struts.faces.taglib.LifecycleListener attributeAdded
INFO: attributeAdded(com.sun.faces.config.WebConfiguration,com.sun.faces.config.WebConfiguration@1de0c09)
Dec 6, 2007 7:27:14 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_07-b03-FCS) for context 'Poetic Web'
Dec 6, 2007 7:27:16 PM org.apache.struts.faces.taglib.LifecycleListener contextInitialized
INFO: contextInitialized()
Dec 6, 2007 7:27:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 6, 2007 7:27:16 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Dec 6, 2007 7:27:16 PM org.apache.struts.faces.taglib.LifecycleListener conte..

Can you please help in this context.


Would be helpful to have the exact version of Tomcat 5.x you're using.
I just tried using Tomcat 5.5.25 and the application deployed.

Also note, if you are using Tomcat 5.x, you *must* be using Facelets and not JSP.
If you're using JSP, then you *must* use Tomcat 6.x.
13 years ago