Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Sealed jar file in both main program (start.jar) and web application

We have a custom applications where we build our own "start.jar", which now
contains both traditional jetty logic and our business logic. For the sake
of argument, assume that start.jar now takes two arguments, either
"runBusinessLogic" or "runWebServer".

As part of the business logic, we need to utilize the Oracle xmlparser, so
META-INF/MANIFEST has a new line (compared to the default shipping version):

    Class-Path: lib/ojdbc6.jar lib/xmlparserv2.jar lib/xml.jar

The web application is built to run on multiple application servers, and
happen to have the file WEB-INF/lib/xmlparserv2.jar.

With the scenario above, we get a problem during context initialization of
the web application:

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from ServletContext resource
[/WEB-INF/applicationContextModel.xml]; nested exception is
javax.xml.parsers.FactoryConfigurationError: Provider
oracle.xml.jaxp.JXDocumentBuilderFactory could not be instantiated:
java.lang.SecurityException: sealing violation: package oracle.xml.jaxp is
sealed

I've tried playing with combinations of serverClasses and systemClasses
(setting none, both, either one), with little luck (but varying errors):

    WebAppContext context = new WebAppContext();
    String[] serverClasses =
(String[])ArrayUtils.add(context.getDefaultServerClasses(), "oracle.xml.");
    context.setServerClasses(serverClasses);
    String[] systemClasses =
(String[])ArrayUtils.add(context.getDefaultSystemClasses(), "oracle.xml.");
    context.setSystemClasses(systemClasses);

I'm a bit at loss here, so I'd like to hear if anybody has any ideas:

- Did anybody ever run into this, and find a nice solution?
- Does anybody have any ideas?

One (wild?) idea that I was think about was to add the non-web business
logic into a WAR-file, load it through a WebAppContext, and then run the
thing directly, somehow, as if it was a jar file. Any thoughts on if that
would work, and if it is anywhere near a good idea?

--
View this message in context: http://jetty.1047016.n5.nabble.com/Sealed-jar-file-in-both-main-program-start-jar-and-web-application-tp4987723p4987723.html
Sent from the jetty-users mailing list archive at Nabble.com.


Back to the top