• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot instantiate component with component-type

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have defined some custom page tag and trying to use it in my application. I am running my server in eclipse and the component class is present in a jar file. While I try to load the page I am getting the exception "SEVERE: JSF1068: Cannot instantiate component with component-type page". Seems that it is not able to load the page component class present inside the jar file.

Interestingly when I extract the component classes and put them directly under the Web Application project in eclipse it works fine.

Please let me know if there is any pointer to the issue.

My web.xml has the following entry

<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/XYZ-taglib.xml</param-value>
</context-param>

Tag defination is

<tag>
<tag-name>page</tag-name>
<component>
<component-type>page</component-type>
</component>
<attribute>
<name>src</name>
<required>true</required>
</attribute>
<attribute>
<name>localName</name>
<required>false</required>
</attribute>
</tag>

And the tag component class is



The error stack trace is

SEVERE: JSF1068: Cannot instantiate component with component-type page
13:01:11,471 ERROR [XYZRenderingManager] render: handleException(RenderingException)
13:01:11,471 ERROR [XYZRenderingManager] Unhandled exception thrown during rendering
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, by your description, it's acting like a classpath problem. How have you added the .jar to your project?

If you can extract the class and place it in the project, and it works, that means there isn't anything structurally wrong with the configuration. So I'd suggest trying a couple of different ways of making the .jar visible to both your project and the server (remember, the fact that the project can see it doesn't necessarily make it possible for the server to see it).

Good luck, and let us know what you find.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The fact that you're running Eclipse is tangental. To work properly, a webapp must be in WAR format, Eclipse or not, and that means that you must have a copy of the JAR in the WAR's WEB-INF/lib directory.

Eclipse normally doesn't automatically do that kind of stuff, which is why tools such as Ant and Maven are commonly used in webapp development. There are Eclipse plugins for both of these tools (Ant is built-in to the standard Java distro).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic