drogatkin / 7Bee

8 stars 2 forks source link

Multiple error exceptions when processing JARs in war file #1

Open flipskills25 opened 8 years ago

flipskills25 commented 8 years ago

Hello, I am having trouble getting my war file deployed to Atjeews. I have a web application that's been webpack-ed and zipped into a war file using grunt. The war file has the following structure:

dist -->
    css-->
        <!--all css styling sheets -->
    fonts-->
        <!--all .ttf and .woff files -->
    images-->
        <!--all .png files -->
    META-INF-->
        <!-- empty -->
    WEB-INF-->
        web.xml
        lib -->
             <!-- bunch of jar files -->
    Other javascript libraries
    index.html
    index.jsp

When I try to run the bee-dexwar.xml on the .war file that has been provided from the Atjeews source, I get multiple errors at the point where the script is processing the jars, such as:

C:\Users\JEFFRE~1.SUN\AppData\Local\Temp\1\war_temp\WEB-INF\lib\xmlsec-1.5.6.jar

trouble processing "javax/xml/crypto/AlgorithmMethod.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.

However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.

If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.

If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.

If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

1 error; aborting

or

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.SecurityException: Please do not leave.
        at org.bee.processor.Task$1.checkExit(Task.java:220)
        at java.lang.Runtime.exit(Runtime.java:107)
        at java.lang.System.exit(System.java:971)
        at com.android.dx.command.dexer.Main.main(Main.java:247)
        at com.android.dx.command.Main.main(Main.java:106)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.bee.processor.Task.eval(Task.java:255)
        at org.bee.processor.For.eval(For.java:51)
        at org.bee.processor.Block.eval(Block.java:48)
        at org.bee.processor.If.eval(If.java:50)
        at org.bee.processor.Block.eval(Block.java:48)
        at org.bee.processor.Expression.eval(Expression.java:33)
        at org.bee.processor.Target.eval(Target.java:53)
        at org.bee.processor.Bee.eval(Bee.java:60)
        at org.bee.processor.Bee.endElement(Bee.java:138)
        at org.bee.processor.Processor$ProcessHandler.endElement(Processor.java:
131)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamesp
aceScope(XMLDTDValidator.java:2054)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEnd
Element(XMLDTDValidator.java:2005)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElemen
t(XMLDTDValidator.java:879)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:606)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:848)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:777)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:649)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:333)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:328)
        at org.bee.processor.Processor.process(Processor.java:60)
        at org.bee.processor.Bee.main(Bee.java:37)
Caused by: org.bee.processor.ProcessException: Called Java class asked for exit.

        ... 36 more

I tried deploying the generated war file to Atjeews anyway, but when i try and upload it through the settings context, it comes up saying "nothing deployed."

drogatkin commented 3 years ago

I am aware of the problem, but there is no a solution for that. If a web application uses something not provided by Android runtime, then it will fail. I only can provide a right messaging to a user instructing to rewrite the app.