Quantcast

Paraboild + JNLP

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Paraboild + JNLP

Radek
This post was updated on .
App works fine when is running locally but when i try to run it using JNLP it gives exceptions during work:

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Error creating extended parser class: Could not load class 'pl.com.backend.statements.jump.JumpParser$$parboiled'
        at org.parboiled.Parboiled.createParser(Parboiled.java:58)
        at pl.com.backend.statements.jump.Statement.fromString(Statement.java:169)
        at pl.com.dialogs.newer.questionElementar.QuestionAdvancedPanel.postInitialize(QuestionAdvancedPanel.java:52)
        at pl.com.dialogs.newer.questionElementar.QuestionAdvancedPanel.<init>(QuestionAdvancedPanel.java:47)
        at pl.com.dialogs.newer.questionElementar.QuestionEditorDialog.<init>(QuestionEditorDialog.java:81)
        at pl.com.frame.JMainFrame.jQuestionDialogButtonMouseClicked(JMainFrame.java:575)
        at pl.com.frame.JMainFrame.access$100(JMainFrame.java:73)
        at pl.com.frame.JMainFrame$7.actionPerformed(JMainFrame.java:356)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.AbstractButton.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$000(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.awt.EventQueue$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.awt.EventQueue$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Could not load class 'pl.com.backend.statements.jump.JumpParser$$parboiled'
        at org.parboiled.transform.AsmUtils.loadClass(AsmUtils.java:239)
        at org.parboiled.transform.ParserTransformer.defineExtendedParserClass(ParserTransformer.java:104)
        at org.parboiled.transform.ParserTransformer.extendParserClass(ParserTransformer.java:51)
        at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:41)
        at org.parboiled.Parboiled.createParser(Parboiled.java:54)
        ... 45 more
Caused by: java.lang.reflect.InvocationTargetException
        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.parboiled.transform.AsmUtils.loadClass(AsmUtils.java:234)
        ... 49 more
Caused by: java.lang.SecurityException: class "pl.com.backend.statements.jump.JumpParser$$parboiled"'s signer information does not match signer information of other classes in the same package
        at java.lang.ClassLoader.checkCerts(Unknown Source)
        at java.lang.ClassLoader.preDefineClass(Unknown Source)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        ... 54 more


What can i do about it?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Paraboild + JNLP

mathias
Administrator
I'm assuming JNLP comes with some class loading restrictions that prevent parboiled from being able to load the synthetically generated extended parser class.
Do you know of such restrictions?

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 24.08.2011, at 11:06, Radek [via parboiled users] wrote:

> App works fine when is running locally but when i try to run it using JNLP it gives exceptions:
>
> Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Error creating extended parser class: Could not load class 'my.parserr$$parboiled'
>         at org.parboiled.Parboiled.createParser(Parboiled.java:58).
>
> What can i do about it?
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Paraboild-JNLP-tp3280445p3280445.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Paraboild + JNLP

tsuckow
> Do you know of such restrictions?

JNLP / Java Web Start runs in a security restricted environment and
cannot create a ClassLoader.
http://download.oracle.com/javase/tutorial/deployment/applet/security.html
I am assuming such functionality would be needed to load the parser
extended classes.

>> What can i do about it?

You can sign all the jars in your application and change the JNLP to
allow more permissions to get around this. I would like to say the
scala parser would not be victim to this because of the lack of a
parser extension phase but I haven't tried.

Thomas Suckow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Paraboild + JNLP

Mark Butler
I am now writing a JavaFX application using the Parboiled parser I wrote. Unfortunately we have a new requirement that it needs to run via Java Web start. This means I am encountering the security problems as described above. I have signed all my jars but the synthetic classes generated by Parboiled seem to be causing a problem.

Any suggestions how to get around this?

Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Paraboild + JNLP

mathias
Administrator
Mark,

I'm afraid there is no workaround.
parboiled for Java needs to be able to load the classes it generated at runtime.
If this is not allowed the whole parser extension cannot be used.

Theoretically you can still use parboiled without parser extension, but you'll forego all the action rewriting, rule caching and recursion support.
So, you are pretty much on your own.

Sorry..

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 19.06.2013, at 09:59, Mark Butler [via parboiled users] <[hidden email]> wrote:

>
>
> I am now writing a JavaFX application using the Parboiled parser I wrote.
> Unfortunately we have a new requirement that it needs to run via Java Web
> start. This means I am encountering the security problems as described
> above. I have signed all my jars but the synthetic classes generated by
> Parboiled seem to be causing a problem.
>
> Any suggestions how to get around this?
>
> Mark
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Paraboild-JNLP-tp3280445p4024210.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, visit
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Paraboild + JNLP

tsuckow
I hadn't considered that the signing would still require the generated classes to be valid. I swear there was a way when using JNI to ask the VM to let you do whatever you want, but it have been so many years since I had to deal with that.

There is also the scala approach, if you did this I would make a small test case to make sure it is immune to the Web Start sandbox.
Loading...