maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From VUB Stefan Seidel <ssei...@vub.de>
Subject Re: Trouble with Tomcat / MyFaces in Maven JUnits
Date Thu, 28 Feb 2008 09:42:35 GMT
Hi Josh,

if it is like that, you can also try if adding the dependency to the 
surefire plugin configuration (I assume you run the tomcat with 
surefire?) works.

Stefan

Joshua ChaitinPollak wrote:
> Hi Stefan,
> 
> Thanks for the suggestion. For now I've just checked the myfaces libs 
> into our webapp directory and moved on. Ugly, but it works.
> 
> -Josh
> 
> On Feb 26, 2008, at 7:37 AM, VUB Stefan Seidel wrote:
> 
>> Hi,
>>
>> I could be totally wrong, but I remember something like tomcat 
>> scanning the JARs in java.class.path for JSP tag libraries. As maven 
>> does not set java.class.path to the test class path, this could be the 
>> problem. In your test, try invoking the method presented in
>> http://markmail.org/message/2lgpzzfyqypvp4km
>> with classes from the myfaces JARs and append the resulting file names 
>> to the system property java.class.path.
>>
>> HTH,
>>
>> Stefan
>>
>> Joshua Pollak wrote:
>>> Hello,
>>> We use embedded Tomcat with MyFaces, and I'm having trouble getting 
>>> them to run properly with Maven. Tomcat itself is working fine, its 
>>> just the Myfaces thats causing trouble, and I'm pretty sure it is 
>>> classpath related, I'm just not sure how to diagnose it. In short, 
>>> the error we get is:
>>> javax.faces.FacesException: The absolute uri: 
>>> http://java.sun.com/jsf/html cannot be resolved in either web.xml or 
>>> the jar files deployed with this application
>>> We don't see this error with our ant build system however (exactly 
>>> the same code, web.xml files, etc), which leads me to suspect Maven's 
>>> classpath shenanigans.
>>> Any help would be appreciated, details are below....
>>> -Josh
>>> I have the following dependencies in our pom.xml:
>>>        <dependency>
>>>            <groupId>org.apache.myfaces.core</groupId>
>>>            <artifactId>myfaces-api</artifactId>
>>>            <version>1.1.5</version>
>>>        </dependency>
>>>        <dependency>
>>>            <groupId>org.apache.myfaces.core</groupId>
>>>            <artifactId>myfaces-impl</artifactId>
>>>            <version>1.1.5</version>
>>>        </dependency>
>>>        <dependency>
>>>            <groupId>org.apache.myfaces.tomahawk</groupId>
>>>            <artifactId>tomahawk</artifactId>
>>>            <version>1.1.5</version>
>>>        </dependency>
>>>        <dependency>
>>>            <groupId>taglibs</groupId>
>>>            <artifactId>standard</artifactId>
>>>            <version>1.1.2</version>
>>>        </dependency>
>>>        <dependency>
>>>            <groupId>javax.servlet</groupId>
>>>            <artifactId>jstl</artifactId>
>>>            <version>1.1.2</version>
>>>        </dependency>
>>> And in an effort to make sure Tomcat was using the right classpath, I 
>>> set it explicitly when we start tomcat:
>>>        // Create a class loader from our own classpath
>>>        Loader classLoader = 
>>> initTomcat.createLoader(this.getClass().getClassLoader());
>>>        classLoader.setDelegate(true);
>>>        Engine baseEngine = initTomcat.createEngine();
>>>        baseEngine.setName(TOMCAT_ENGINE_NAME);
>>>        baseEngine.setDefaultHost(TOMCAT_HOST);
>>>        
>>> baseEngine.setParentClassLoader(this.getClass().getClassLoader());
>>>        // Create Host
>>>        Host baseHost = initTomcat.createHost(TOMCAT_HOST, "");
>>>        // add host to Engine
>>>        baseEngine.addChild(baseHost);
>>>        Context rootCtx = initTomcat.createContext("/", "webapp");
>>>        rootCtx.setPrivileged(true);
>>>        rootCtx.setLoader(classLoader);
>>>        baseHost.addChild(rootCtx);
>>>        PersistentManager manager = new PersistentManager();
>>>        manager.setSaveOnRestart(false);
>>>        rootCtx.setManager(manager);
>>> But I see the following when I try and load a .jsf file:
>>> javax.faces.FacesException: The absolute uri: 
>>> http://java.sun.com/jsf/html cannot be resolved in either web.xml or 
>>> the jar files deployed with this application
>>>        at 
>>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
        
>>> at 
>>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
        
>>> at 
>>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
        
>>> at 
>>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132) 
>>>
>>>        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
>>>        at 
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        
>>> at 
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        
>>> at 
>>> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
        
>>> at 
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        
>>> at 
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        
>>> at 
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        
>>> at 
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        
>>> at 
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        
>>> at 
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        
>>> at 
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        
>>> at 
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 
>>>
>>>        at 
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 
>>>
>>>        at 
>>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
        
>>> 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:613)
>>> Caused by: org.apache.jasper.JasperException: The absolute uri: 
>>> http://java.sun.com/jsf/html cannot be resolved in either web.xml or 
>>> the jar files deployed with
>>> this application
>>>        at 
>>> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
        
>>> at 
>>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
        
>>> at 
>>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>>>        at 
>>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>>        at 
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        
>>> at 
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        
>>> at 
>>> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        
>>> at 
>>> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        
>>> at 
>>> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        
>>> at 
>>> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        
>>> at 
>>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
        
>>> ... 21 more
>>
>> -- 
>> best regards,
>>
>> Stefan Seidel
>> software developer
>> ________________________
>> VUB Printmedia GmbH
>> Chopinstraße 4
>> D-04103 Leipzig
>> Germany
>> tel.    +49 (341) 9 60 50 07
>> fax.    +49 (341) 9 60 50 92
>> mail.   sseidel@vub.de
>> web.    www.vub.de
>>
>> HRB Köln 24015
>> UStID DE 122 649 251
>> GF Dr. Achim Preuss Neudorf,
>> Dr. Christian Preuss Neudorf
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message