You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by beginner_prithvi <he...@gmail.com> on 2009/11/17 15:06:56 UTC

loader constraints violated when linking javax/el/ELResolver class error

Whenever i try to run some application, i get resource not available 404
error. I checked the logs and I saw following error.
I searched on the internet, but nowhere correct information has given.

While starting tomcat I am getting this error:

Nov 17, 2009 6:04:25 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class com.sun.faces.config.ConfigureListener
java.lang.LinkageError: loader constraints violated when linking
javax/el/ELResolver class
	at
com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:1633)
	at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:453)
	at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
	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:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 17, 2009 6:04:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 17, 2009 6:04:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/LogIt1] startup failed due to previous errors
Nov 17, 2009 6:04:25 PM org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: validateJarFile(D:\Prithvi\Project\Tools\Eclipse
3.3\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\LogIt\WEB-INF\lib\servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
Nov 17, 2009 6:04:26 PM org.apache.catalina.core.StandardContext
addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener"
is already configured for this context. The duplicate definition has been
ignored.
log4j:WARN No appenders could be found for logger
(org.apache.myfaces.webapp.StartupServletContextListener).
log4j:WARN Please initialize the log4j system properly.
Nov 17, 2009 6:04:27 PM com.sun.faces.config.ConfigureListener
contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b07-FCS)
for context '/LogIt'
Nov 17, 2009 6:04:27 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-1255
Nov 17, 2009 6:04:27 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:1256
Nov 17, 2009 6:04:28 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/79  config=null
Nov 17, 2009 6:04:28 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5867 ms


I am using eclipse for development. Following is the configuration in my
web.xml: 

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
  <display-name>LogIt</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <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>
  
<!--
*******************************************************************************
-->

    <!-- Extensions Filter -->
    <filter>
      <description>Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB
      </description>
	  <filter-name>MyFacesExtensionsFilter</filter-name>
	 
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
      <init-param>
            <param-name>maxFileSize</param-name>
            <param-value>20m</param-value>
      </init-param>
    </filter>
    
    <!-- extension mapping for adding <script/>, <link/>, and other resource
tags to JSF-pages  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <!-- servlet-name must match the name of your
javax.faces.webapp.FacesServlet entry -->
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>

    <!-- extension mapping for serving page-independent resources
(javascript, stylesheets, images, etc.)  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>


    <context-param>
        <description>
            Comma separated list of URIs of (additional) faces config files.
            (e.g. /WEB-INF/my-config.xml)
            See JSF 1.0 PRD2, 10.3.2
        </description>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>
            /WEB-INF/faces-config.xml
        </param-value>
    </context-param>

    <context-param>
        <description>
            State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.2
        </description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>

    <context-param>
        <description>
            This parameter tells MyFaces if javascript code should be
allowed in the
            rendered HTML output.
            If javascript is allowed, command_link anchors will have
javascript code
            that submits the corresponding form.
            If javascript is not allowed, the state saving info and nested
parameters
            will be added as url parameters.
            Default: "true"
        </description>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <description>
            If true, rendered HTML code will be formatted, so that it is
"human readable".
            i.e. additional line separators and whitespace will be written,
that do not
            influence the HTML code.
            Default: "true"
        </description>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <description>
            If true, a javascript function will be rendered that is able to
restore the
            former vertical scroll on every request. Convenient feature if
you have pages
            with long lists and you do not want the browser page to always
jump to the top
            if you trigger a link or button action that stays on the same
page.
            Default: "false"
        </description>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- Listener, that does all the startup work (configuration, init). -->
    <listener>
       
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>

</web-app>

Following is the list of different jars in my lib folder:
commons-beanutils-1.8.0-BETA.jar
commons-beanutils-bean-collections-1.8.0-BETA.jar
commons-beanutils-core-1.8.0-BETA.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-el.jar
commons-logging-1.1.1.jar
hsqldb.jar
jsf-api-1.2_04.jar
jsf-impl-1.2_04.jar
jstl-1.2.jar
log4j-123.jar
myfaces-impl-1.1.5.jar
servlet-api.jar
tomahawk-1.1.3.jar


Please anyone can give me some expert solution for this. I am stuck up with
this problem for past two days :,(

-- 
View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26390522.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by beginner_prithvi <he...@gmail.com>.
Hi Mike,Richard,
Thank you very much for your immediate help.
Actually I was trying to use tomahawk in order to implement dynamic tabs.
I searched on the internet and found RichFaces can do this job very easily.
So instead of tomahawk now I am using RichFaces :)

@Mike,
As you said you work in facelets, I have some queries in the same and I have
posted it in facelets user forum. I will appreciate if i get some more help
from you.

@Richard,
I will appreciate your help also :)


Mike Kienenberger wrote:
> 
> On Wed, Nov 18, 2009 at 1:00 AM, beginner_prithvi <he...@gmail.com>
> wrote:
>> Here is my .classpath file. How do you want me to arrange contents in it?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <classpath>
>>        <classpathentry kind="src" path="src"/>
>>        <classpathentry kind="con"
>> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>>        <classpathentry kind="con"
>> path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache
>> Tomcat v6.0"/>
>>        <classpathentry kind="con"
>> path="org.eclipse.jst.j2ee.internal.module.container"/>
>>        <classpathentry kind="con"
>> path="org.eclipse.jst.j2ee.internal.web.container"/>
>>        <classpathentry kind="output" path="build/classes"/>
>> </classpath>
> 
> Just a guess, but I'd say try putting Apache Tomcat v6.0 at the top.
> You might also need to put web.container up there -- maybe after
> Tomcat.
> 
> Again, this helped for jetty, but might not matter for Tomcat.
> Tomcat v6 definitely contains its own el implementation, though.
> 
> Removing the myfaces jars are probably only removing the calls to the
> el api.   They are probably not the cause of the conflict.
> 
> 

-- 
View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26421292.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by Mike Kienenberger <mk...@gmail.com>.
On Wed, Nov 18, 2009 at 1:00 AM, beginner_prithvi <he...@gmail.com> wrote:
> Here is my .classpath file. How do you want me to arrange contents in it?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
>        <classpathentry kind="src" path="src"/>
>        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>        <classpathentry kind="con"
> path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache
> Tomcat v6.0"/>
>        <classpathentry kind="con"
> path="org.eclipse.jst.j2ee.internal.module.container"/>
>        <classpathentry kind="con"
> path="org.eclipse.jst.j2ee.internal.web.container"/>
>        <classpathentry kind="output" path="build/classes"/>
> </classpath>

Just a guess, but I'd say try putting Apache Tomcat v6.0 at the top.
You might also need to put web.container up there -- maybe after
Tomcat.

Again, this helped for jetty, but might not matter for Tomcat.
Tomcat v6 definitely contains its own el implementation, though.

Removing the myfaces jars are probably only removing the calls to the
el api.   They are probably not the cause of the conflict.

Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by Richard Yee <ri...@gmail.com>.
Use the myfaces 1.2.x and the tomahawk 1.2 libs. Tomcat supportsxjsf 1.2

R

Sent from my iPhone

On Nov 17, 2009, at 10:00 PM, beginner_prithvi <he...@gmail.com>  
wrote:

>
> This error comes when i add either one of the following jars:
> myfaces-impl-1.1.5.jar
> tomahawk-1.1.3.jar
>
> Is there any problem in these jars?
>
> Here is my .classpath file. How do you want me to arrange contents  
> in it?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
>    <classpathentry kind="src" path="src"/>
>    <classpathentry kind="con"  
> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>    <classpathentry kind="con"
> path="org.eclipse.jst.server.core.container/ 
> org.eclipse.jst.server.tomcat.runtimeTarget/Apache
> Tomcat v6.0"/>
>    <classpathentry kind="con"
> path="org.eclipse.jst.j2ee.internal.module.container"/>
>    <classpathentry kind="con"
> path="org.eclipse.jst.j2ee.internal.web.container"/>
>    <classpathentry kind="output" path="build/classes"/>
> </classpath>
>
>
>
> Mike Kienenberger wrote:
>>
>> It's probably the el-api.jar (and possibly also el-ri.jar).
>>
>> Jsp 2.1 provides its own el-api (and I think perhaps el-ri as well,
>> but I'm no expert on jsp -- I do all of my development in facelets).
>>
>> I had this "java.lang.LinkageError: loader constraints violated when
>> linking javax/el/ELResolver class" problem a couple of weeks ago with
>> jetty.  It was followed by some class-not-found/class-cast issues,
>> which turned out to be fixed by insuring that the jetty & jetty jsp
>> jars were the first item in the class path.
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26402977.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>

Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by beginner_prithvi <he...@gmail.com>.
This error comes when i add either one of the following jars:
myfaces-impl-1.1.5.jar
tomahawk-1.1.3.jar

Is there any problem in these jars?

Here is my .classpath file. How do you want me to arrange contents in it?

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache
Tomcat v6.0"/>
	<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
	<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
	<classpathentry kind="output" path="build/classes"/>
</classpath>



Mike Kienenberger wrote:
> 
> It's probably the el-api.jar (and possibly also el-ri.jar).
> 
> Jsp 2.1 provides its own el-api (and I think perhaps el-ri as well,
> but I'm no expert on jsp -- I do all of my development in facelets).
> 
> I had this "java.lang.LinkageError: loader constraints violated when
> linking javax/el/ELResolver class" problem a couple of weeks ago with
> jetty.  It was followed by some class-not-found/class-cast issues,
> which turned out to be fixed by insuring that the jetty & jetty jsp
> jars were the first item in the class path.
> 
> 

-- 
View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26402977.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by Mike Kienenberger <mk...@gmail.com>.
It's probably the el-api.jar (and possibly also el-ri.jar).

Jsp 2.1 provides its own el-api (and I think perhaps el-ri as well,
but I'm no expert on jsp -- I do all of my development in facelets).

I had this "java.lang.LinkageError: loader constraints violated when
linking javax/el/ELResolver class" problem a couple of weeks ago with
jetty.  It was followed by some class-not-found/class-cast issues,
which turned out to be fixed by insuring that the jetty & jetty jsp
jars were the first item in the class path.

On Tue, Nov 17, 2009 at 9:42 AM, beginner_prithvi <he...@gmail.com> wrote:
>
> Hi Richard,
> Thanks for immediate reply!
> I tried removing servlet-API.jar, but still i am facing the same problem.
> Can you please tell me the list of other jars which are supplied by the
> container, so that i can try one by one, and will let you know soon the
> results.
>
>
> Richard Yee-3 wrote:
>>
>> Remove servlet-API.jar from your webapp. It is supplied by the
>> container.
>>
>> Richard
>>
>> Sent from my iPhone
>>
>
>
>
>
>
> --
> View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26391131.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: loader constraints violated when linking javax/el/ELResolver class error

Posted by beginner_prithvi <he...@gmail.com>.
Hi Richard,
Thanks for immediate reply!
I tried removing servlet-API.jar, but still i am facing the same problem.
Can you please tell me the list of other jars which are supplied by the
container, so that i can try one by one, and will let you know soon the
results.


Richard Yee-3 wrote:
> 
> Remove servlet-API.jar from your webapp. It is supplied by the  
> container.
> 
> Richard
> 
> Sent from my iPhone
> 





-- 
View this message in context: http://old.nabble.com/loader-constraints-violated-when-linking-javax-el-ELResolver-class-error-tp26390522p26391131.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.