Joakim,

Thank you for replying.

I tried that and it works for the first context, but for some reason for the second one I get the following error:

2017-07-13 18:05:34.217:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@62d363ab{/,file:///E:/Workspace/git/LuceeDebug/webapps/LDEV-1369/context2/,UNAVAILABLE,localhost2.com}{E:\Workspace\git\LuceeDebug\webapps\LDEV-1369\context2}
java.lang.IllegalArgumentException: name
    at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:693)
    at sun.misc.URLClassPath.findResource(URLClassPath.java:215)
    at java.net.URLClassLoader$2.run(URLClassLoader.java:569)
    at java.net.URLClassLoader$2.run(URLClassLoader.java:567)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findResource(URLClassLoader.java:566)
    at java.lang.ClassLoader.getResource(ClassLoader.java:1096)
at org.eclipse.jetty.util.resource.Resource.newSystemResource(Resource.java:242) at org.eclipse.jetty.webapp.WebXmlConfiguration.preConfigure(WebXmlConfiguration.java:50) at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:506) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:544) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
    at org.eclipse.jetty.server.Server.start(Server.java:452)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
    at org.eclipse.jetty.server.Server.doStart(Server.java:419)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

Any thoughts?

Thanks again,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 7/13/2017 3:50 PM, Joakim Erdfelt wrote:
Drop the following ...

webapp.setResourceBase(resourceBase);
webapp.setDescriptor(resourceBase + "/WEB-INF/web.xml");

And replace it with ...

webapp.setWar(resourceBase);

That will address all 3 issues.


Joakim Erdfelt / [email protected] <mailto:[email protected]>

On Thu, Jul 13, 2017 at 12:01 PM, Igal @ Lucee.org <[email protected] <mailto:[email protected]>> wrote:

    I'm trying to set up a default descriptor in a shared place, and a
    specific descriptor in WEB-INF/web.xml

    I have two contexts, and I use the method below to define them.  I
    get the following error for the 2nd context (seems like the first
    one doesn't error):

    2017-07-13 11:59:02.116:WARN:oejw.WebAppContext:main: Failed
    startup of context
    
o.e.j.w.WebAppContext@37cd92d6{/,file:///E:/Workspace/git/Debug/webapps/context2/,UNAVAILABLE,localhost2.com}
    java.lang.IllegalArgumentException: name
        at
    sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:693)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:215)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:569)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:567)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:566)
        at java.lang.ClassLoader.getResource(ClassLoader.java:1096)
        at
    
org.eclipse.jetty.util.resource.Resource.newSystemResource(Resource.java:242)
        at
    
org.eclipse.jetty.webapp.WebXmlConfiguration.preConfigure(WebXmlConfiguration.java:50)
        at
    org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:506)
        at
    org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:544)
        at
    
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at
    
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at
    
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at
    
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
        at
    
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at
    
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.server.Server.start(Server.java:452)
        at
    
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
        at
    
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
        at org.eclipse.jetty.server.Server.doStart(Server.java:419)
        at
    
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

        /** * * @param resourceBase the path to the web root * @param
    contextPath the virtual path for the context, e.g. "/" * @return *
    @throws Exception */ public static WebAppContext createWebAppContext(String 
resourceBase, String contextPath)throws Exception {

           File file =new File(resourceBase);

           resourceBase = file.getCanonicalPath();

           if (contextPath ==null || contextPath.isEmpty())
              contextPath ="/";

           WebAppContext webapp =new WebAppContext();
           webapp.setContextPath(contextPath);
           webapp.setResourceBase(resourceBase);

           webapp.setConfigurationClasses(webappDefaultConfigurationClasses);

           // Set default descriptor for all contexts
    
*webapp.setDefaultsDescriptor(DebugLucee.class.getResource("/resource/web.xml").getPath());*
    // Set app-specific descriptor at {webroot}/WEB-INF/web.xml        
webapp.setDescriptor(resourceBase +"/WEB-INF/web.xml");

           return webapp;
        }

        public static final String[]webappDefaultConfigurationClasses =new 
String[]{
           "org.eclipse.jetty.webapp.WebInfConfiguration" ,"org.eclipse.jetty.webapp.WebXmlConfiguration" 
,"org.eclipse.jetty.webapp.MetaInfConfiguration" ,"org.eclipse.jetty.webapp.FragmentConfiguration" 
,"org.eclipse.jetty.annotations.AnnotationConfiguration" ,"org.eclipse.jetty.webapp.JettyWebXmlConfiguration" };

    Is it possible to achieve that?  If so, how?  Thanks!

    Igal Sapir
    Lucee Core Developer
    Lucee.org <http://lucee.org/>


    _______________________________________________
    jetty-users mailing list
    [email protected] <mailto:[email protected]>
    To change your delivery options, retrieve your password, or
    unsubscribe from this list, visit
    https://dev.eclipse.org/mailman/listinfo/jetty-users
    <https://dev.eclipse.org/mailman/listinfo/jetty-users>




_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to