Skip to main content

Annotations in jars

3 replies [Last post]
alexschmidt
Offline
Joined: 2009-10-08

Putting the class files in WEB-INF\classes all annotations are processed correctly.
After packaging the class files in a jar under WEB-INF\lib the annotations are no longer resolved.

Using the guessnumber sample and packaging the class files I got following StackTrace:

javax.faces.FacesException: Ausdrucksfehler: Benanntes Objekt ClientSideValidator nicht gefunden.
com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:1493)
com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl.createValidator(ValidatorTagHandlerDelegateImpl.java:234)

JSF 2.0.1
Tomcat 6.0.18

Any help appreciated,

Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexschmidt
Offline
Joined: 2009-10-08

Adding the empty faces-config.xml to the META-INF directory of the JAR file solved the problem.

Thanks,

Alex

Ryan Lubke

On 12/1/09 2:35 AM, webtier@javadesktop.org wrote:
> Putting the class files in WEB-INF\classes all annotations are processed correctly.
> After packaging the class files in a jar under WEB-INF\lib the annotations are no longer resolved.
>
You need to make sure you have an empty faces-config.xml (empty, but
still well-formed xml, so a starting and ending faces-config element) in
the META-INF directory of the JAR file, otherwise that jar won't be scanned.
> Using the guessnumber sample and packaging the class files I got following StackTrace:
>
> javax.faces.FacesException: Ausdrucksfehler: Benanntes Objekt ClientSideValidator nicht gefunden.
> com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:1493)
> com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl.createValidator(ValidatorTagHandlerDelegateImpl.java:234)
>
>
> JSF 2.0.1
> Tomcat 6.0.18
>
> Any help appreciated,
>
> Alex
> [Message sent by forum member 'alexschmidt' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=374024
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Shing Wai Chan

It should be working in GlassFish v3. What annotations are you using
annotations?
(Are you using Tomcat 6.0.18 as mentioned below? )
Shing Wai Chan

webtier@javadesktop.org wrote:
> Putting the class files in WEB-INF\classes all annotations are processed correctly.
> After packaging the class files in a jar under WEB-INF\lib the annotations are no longer resolved.
>
> Using the guessnumber sample and packaging the class files I got following StackTrace:
>
> javax.faces.FacesException: Ausdrucksfehler: Benanntes Objekt ClientSideValidator nicht gefunden.
> com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:1493)
> com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl.createValidator(ValidatorTagHandlerDelegateImpl.java:234)
>
>
> JSF 2.0.1
> Tomcat 6.0.18
>
> Any help appreciated,
>
> Alex
> [Message sent by forum member 'alexschmidt' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=374024
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net