RESTXQ problem (bug?!)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

RESTXQ problem (bug?!)

Immanuel Normann
Hi,

the following restxq behaviour looks like a bug:

In /db/howto/restxq/test.xql I have a simple resource function that just should return the content of an XML-document:

declare
  %rest:GET
  %rest:path("/test/xml")
  %rest:produces("application/xml")
function ex:test(){
    doc("/db/howto/restxq/xml/test.xml")/test
};


And this is my XML-document in /db/howto/restxq/xml/test.xml :

<test/>

The request http://localhost:8080/exist/restxq/test/xml returns this error message:

HTTP ERROR 500

Problem accessing /exist/restxq/test/xml. Reason:

    java.lang.reflect.InvocationTargetException-->null

Caused by:

net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
  ...

Caused by:

java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
  ...

Caused by:

java.lang.SecurityException: class "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
  ...

sHowever, when I replace in test.xql the function body

    doc("/db/howto/restxq/xml/test.xml")/test

by

    <x>{doc("/db/howto/restxq/xml/test.xml")/test}</x>/test

then I get the content "<test/>". This is obviously strange as both expressions should return the same result.

Immanuel

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

cmisztur

Is it really a bug?

 

You’re serializing an empty string to XML.

 

Chris | http://www.clipartbest.com/cliparts/eTM/9go/eTM9go8Tn.png (312) 504-0681

Inline image 1

 

 

From: Immanuel Normann [mailto:[hidden email]]
Sent: Monday, June 22, 2015 3:42 AM
To: [hidden email]
Subject: [Exist-open] RESTXQ problem (bug?!)

 

Hi,

the following restxq behaviour looks like a bug:

In /db/howto/restxq/test.xql I have a simple resource function that just should return the content of an XML-document:

declare
  %rest:GET
  %rest:path("/test/xml")
  %rest:produces("application/xml")
function ex:test(){
    doc("/db/howto/restxq/xml/test.xml")/test
};


And this is my XML-document in /db/howto/restxq/xml/test.xml :

<test/>

The request http://localhost:8080/exist/restxq/test/xml returns this error message:

HTTP ERROR 500

Problem accessing /exist/restxq/test/xml. Reason:

    java.lang.reflect.InvocationTargetException-->null

Caused by:

net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
  ...

Caused by:

java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
  ...

Caused by:

java.lang.SecurityException: class "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
  ...

sHowever, when I replace in test.xql the function body

    doc("/db/howto/restxq/xml/test.xml")/test

by

    <x>{doc("/db/howto/restxq/xml/test.xml")/test}</x>/test

then I get the content "<test/>". This is obviously strange as both expressions should return the same result.

Immanuel




The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

wshager
@Chris: In the case of an empty string, any java errors should be handled or suppressed, or it would not be xq.

2015-06-22 14:29 GMT+02:00 Misztur, Chris <[hidden email]>:

Is it really a bug?

 

You’re serializing an empty string to XML.

 

Chris | http://www.clipartbest.com/cliparts/eTM/9go/eTM9go8Tn.png (312) 504-0681

Inline image 1

 

 

From: Immanuel Normann [mailto:[hidden email]]
Sent: Monday, June 22, 2015 3:42 AM
To: [hidden email]
Subject: [Exist-open] RESTXQ problem (bug?!)

 

Hi,

the following restxq behaviour looks like a bug:

In /db/howto/restxq/test.xql I have a simple resource function that just should return the content of an XML-document:

declare
  %rest:GET
  %rest:path("/test/xml")
  %rest:produces("application/xml")
function ex:test(){
    doc("/db/howto/restxq/xml/test.xml")/test
};


And this is my XML-document in /db/howto/restxq/xml/test.xml :

<test/>

The request http://localhost:8080/exist/restxq/test/xml returns this error message:

HTTP ERROR 500

Problem accessing /exist/restxq/test/xml. Reason:

    java.lang.reflect.InvocationTargetException-->null

Caused by:

net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
  ...

Caused by:

java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
  ...

Caused by:

java.lang.SecurityException: class "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
  ...

sHowever, when I replace in test.xql the function body

    doc("/db/howto/restxq/xml/test.xml")/test

by

    <x>{doc("/db/howto/restxq/xml/test.xml")/test}</x>/test

then I get the content "<test/>". This is obviously strange as both expressions should return the same result.

Immanuel




The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open




--

W.S. Hager
Lagua Web Solutions
http://lagua.nl


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

Immanuel Normann
In reply to this post by cmisztur
BTW. in this example I am not serializing an empty string, but an empty element - namely <test/> which is well formed XML.
And in fact when I evaluate my function ex:test() inside eXide it gives me this <test/>, but as resource function it fails to do so.

2015-06-22 14:29 GMT+02:00 Misztur, Chris <[hidden email]>:

Is it really a bug?

 

You’re serializing an empty string to XML.

 





------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

Dannes Wessels-3
In reply to this post by Immanuel Normann
Hi,

Did you build eXist yourself? What version of exist are you using?

The message is (more or less clear): the java vm requires jar files to be signed by the same certificate......

Cheers

Dannes



--
http://www.exist-db.org

> On 22 Jun 2015, at 09:42, Immanuel Normann <[hidden email]> wrote:
>
> Caused by:
>
> java.lang.SecurityException: class "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information does not match signer information of other classes in the same package
>     at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

Dmitriy Shabanov
In reply to this post by Immanuel Normann
On Mon, Jun 22, 2015 at 11:42 AM, Immanuel Normann <[hidden email]> wrote:

java.lang.SecurityException: class "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
  ...
How you build and run eXist?

--
Dmitriy Shabanov

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: RESTXQ problem (bug?!)

Adam Retter
In reply to this post by Immanuel Normann
This is not an issue with RESTXQ, it is just that RESTXQ reveals the
problem for you.

We use CGLIB to generate some proxy classes in eXist at runtime, you
need to make sure your jar signing is setup and consistent. You can
find various articles covering this via Google, and the CGLIB FAQ -
http://cglib.sourceforge.net/howto.html

On 22 June 2015 at 09:42, Immanuel Normann <[hidden email]> wrote:

> Hi,
>
> the following restxq behaviour looks like a bug:
>
> In /db/howto/restxq/test.xql I have a simple resource function that just
> should return the content of an XML-document:
>
> declare
>   %rest:GET
>   %rest:path("/test/xml")
>   %rest:produces("application/xml")
> function ex:test(){
>     doc("/db/howto/restxq/xml/test.xml")/test
> };
>
> And this is my XML-document in /db/howto/restxq/xml/test.xml :
>
> <test/>
>
> The request http://localhost:8080/exist/restxq/test/xml returns this error
> message:
>
> HTTP ERROR 500
>
> Problem accessing /exist/restxq/test/xml. Reason:
>
>     java.lang.reflect.InvocationTargetException-->null
>
> Caused by:
>
> net.sf.cglib.core.CodeGenerationException:
> java.lang.reflect.InvocationTargetException-->null
>     at
> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
>   ...
>
> Caused by:
>
> java.lang.reflect.InvocationTargetException
>     at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
>   ...
>
> Caused by:
>
> java.lang.SecurityException: class
> "org.exist.dom.NodeProxy$$EnhancerByCGLIB$$5613c2c7"'s signer information
> does not match signer information of other classes in the same package
>     at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
>   ...
>
> sHowever, when I replace in test.xql the function body
>
>     doc("/db/howto/restxq/xml/test.xml")/test
>
> by
>
>     <x>{doc("/db/howto/restxq/xml/test.xml")/test}</x>/test
>
> then I get the content "<test/>". This is obviously strange as both
> expressions should return the same result.
>
> Immanuel
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>



--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open