As a extra note, I had to force the Jena supplied org.apache.http to load, 
opposed to the original one
This is done in the Geronimo deployment plan.

Bart

Bart van Leeuwen <[email protected]> wrote on 29-08-2012 
20:16:49:

> From: Bart van Leeuwen <[email protected]>
> To: [email protected], 
> Date: 29-08-2012 20:17
> Subject: Re: Sparql 11 Remote Update Query in J2EE container
> 
> Hi Andy,
> 
> That was a good hint !
> 
> I've moved to Xerces 2.9.1 in the Apache Jena 2.7.3 distribution and 
this 
> works fine now.
> I think it would be smart to document this somehow, having guides on how 

> to use Jena in a enterprise environment would be valuable.
> Any hints on where to contribute would be appreciated
> 
> Met Vriendelijke Groet / With Kind Regards
> Bart van Leeuwen
> @semanticfire
> 
> ##############################################################
> # netage.nl
> # http://netage.nl
> # Enschedepad 76
> # 1324 GJ Almere
> # The Netherlands
> # tel. +31(0)36-5347479
> ##############################################################
> 
> 
> 
> From:   Andy Seaborne <[email protected]>
> To:     [email protected], 
> Date:   29-08-2012 10:48
> Subject:        Re: Sparql 11 Remote Update Query in J2EE container
> Sent by:        Andy Seaborne <[email protected]>
> 
> 
> 
> Which version of xml-apis is in your environment?
> 
> Jena uses Xerces 2.10.0 which depends on xml-apis 1.4.01 which includes 
> org/w3c/dom/ElementTraversal.
> 
> xml-apis 1.3.0 does not include org/w3c/dom/ElementTraversal.
> 
> Xerces 2.9.1 depends on xml-apis 1.3.0.
> 
> What might well work is using Xerces 2.9.1 with Jena.  I don't think we 
> have any specific requirement to use use Xerces 2.10.0 but Xerces and 
> xml-pais must move in-step.
> 
> (versions of Xerces have been a perennial problems - various systems, 
> esp containers, require or even force specific versions, but there is no 

> 'right' choice for every thing).
> 
>                  Andy
> 
> 
> On 28/08/12 19:55, Bart van Leeuwen wrote:
> > Okay
> >
> > I decided to completely give up on this for now, instead I implemented 
a
> > very simple Sparql11 update function which uses HttpUrlConnection to 
do
> > the Post.
> >
> > It seems that the standard environment shipped with the Jena binary
> > doesn't really match that what is supplied with Geronimo.
> > Is there a solution for this ? building it from source with the libs 
> from
> > Geronimo ?
> >
> > Any advice would be greatly appreciated.
> >
> > Met Vriendelijke Groet / With Kind Regards
> > Bart van Leeuwen
> > @semanticfire
> >
> > ##############################################################
> > # netage.nl
> > # http://netage.nl
> > # Enschedepad 76
> > # 1324 GJ Almere
> > # The Netherlands
> > # tel. +31(0)36-5347479
> > ##############################################################
> >
> >
> >
> > From:   Milorad Tosic <[email protected]>
> > To:     "[email protected]" <[email protected]>,
> > Date:   28-08-2012 12:01
> > Subject:        Re: Sparql 11 Remote Update Query in J2EE container
> >
> >
> >
> > I'm not familiar with Geronimo. However, the settings could be applied 

> at
> > container level but also at application level, if that helps you at 
all?
> > That would be my best guess where to target efforts...
> >
> >
> > Milorad
> >
> >
> >
> >
> >> ________________________________
> >> From: Bart van Leeuwen <[email protected]>
> >> To: [email protected]
> >> Sent: Tuesday, August 28, 2012 11:39 AM
> >> Subject: Re: Sparql 11 Remote Update Query in J2EE container
> >>
> >> Hi Milorad,
> >>
> >> This sounds like something that could work, however geronimo doesn't
> >> accept this in the deployment plan.
> >> I'm a bit reluctant to set this system wide. any other ideas ?
> >>
> >>
> >> Met Vriendelijke Groet / With Kind Regards
> >> Bart van Leeuwen
> >> @semanticfire
> >>
> >> ##############################################################
> >> # netage.nl
> >> # http://netage.nl
> >> # Enschedepad 76
> >> # 1324 GJ Almere
> >> # The Netherlands
> >> # tel. +31(0)36-5347479
> >> ##############################################################
> >>
> >>
> >>
> >> From:   Milorad Tosic <[email protected]>
> >> To:     "[email protected]" <[email protected]>,
> >> Date:   28-08-2012 11:17
> >> Subject:        Re: Sparql 11 Remote Update Query in J2EE container
> >>
> >>
> >>
> >> Hi,
> >>
> >> I have had a similar problem some time ago and it turned to be XML
> >> compiler issue that is solved if the container is directed to use
> >> appropriate version of XML compiler. What worked for me is the 
> following
> >> settings in web.xml:
> >>
> >>   <system-property javax.xml.parsers.DocumentBuilderFactory=
> >>
> >> 
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/>
> >>   <system-property javax.xml.parsers.SAXParserFactory=
> >>
> >> "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/>
> >>
> >>
> >> regards,
> >> Milorad
> >>
> >>
> >>
> >>
> >>> ________________________________
> >>> From: Bart van Leeuwen <[email protected]>
> >>> To: [email protected]
> >>> Sent: Tuesday, August 28, 2012 11:02 AM
> >>> Subject: Sparql 11 Remote Update Query in J2EE container
> >>>
> >>> Hi List,
> >>>
> >>> I'm having a issue with Jena Update in a J2EE deployed servlet
> >>> 1) J2EE container is geronimo v3
> >>> 2) Jena is version 2.7.3
> >>>
> >>> I like to have a servlet do a Sparql11 update request to a remote 
1.1
> >>> store.
> >>>
> >>> When I create a standalone java application and run the code it 
works
> >>> fine, when I use the same code in a servlet I run into a class not 
> found
> >
> >>> exception
> >>> The package deployed to the server does contain all the right jars.
> >>>
> >>> I'm not sure if this is a Jena or Geronimo issue.
> >>>
> >>> Code:
> >>>
> >>> UpdateRequest update = UpdateFactory.create("insert data { GRAPH <
> >>> http://example.com> { <http://example/book1>  <http://blah>  42 }
> >>> }",Syntax.syntaxSPARQL_11);
> >>> UpdateProcessRemote firebrary = (UpdateProcessRemote)
> >>> UpdateExecutionFactory.createRemote(update, "
> >>> http://localhost:3030/firebrary/update";);
> >>> firebrary.execute();
> >>>
> >>> Exception:
> >>>
> >>> com.hp.hpl.jena.query.QueryParseException: 
> org/w3c/dom/ElementTraversal
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate._parse(ParserARQUpdate.java:86)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate.parse$(ParserARQUpdate.java:41)
> >>> com.hp.hpl.jena.sparql.lang.UpdateParser.parse(UpdateParser.java:42)
> >>> com.hp.hpl.jena.update.UpdateFactory.make(UpdateFactory.java:84)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:75)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:53)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:43)
> >>>         tester.Tester.go(Tester.java:26)
> >>>         info.resc.sandbox.GenericTest.doGet(GenericTest.java:43)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
> >>>
> >>> root cause
> >>>
> >>> java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
> >>>         java.lang.ClassLoader.defineClass1(Native Method)
> >>>         java.lang.ClassLoader.defineClass(ClassLoader.java:791)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.defineClass
> (GeronimoClassLoader.java:213)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass
> (ClasspathManager.java:601)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl
> (ClasspathManager.java:567)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl
> (ClasspathManager.java:490)
> >>>
> >>> 
> 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader
> (ClasspathManager.java:478)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass
> (ClasspathManager.java:458)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.findLocalClass
> (GeronimoClassLoader.java:237)
> >>>
> >>> 
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass
> (BundleLoader.java:400)
> >>>
> >>> 
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal
> (BundleLoader.java:476)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass
> (GeronimoClassLoader.java:85)
> >>>         java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> >>>
> > org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown
> >>
> >>> Source)
> >>> org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown
> >
> >>> Source)
> >>>
> > org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown
> >>
> >>> Source)
> >>> 
org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown
> >>> Source)
> >>>         org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >>>         org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >>>         org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> >>>         org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> >>>         org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown 
> Source)
> >>>         java.util.XMLUtils.getLoadingDoc(XMLUtils.java:102)
> >>>         java.util.XMLUtils.load(XMLUtils.java:74)
> >>>         java.util.Properties.loadFromXML(Properties.java:868)
> >>>         com.hp.hpl.jena.util.Metadata.read(Metadata.java:80)
> >>>         com.hp.hpl.jena.util.Metadata.addMetadata(Metadata.java:54)
> >>>         com.hp.hpl.jena.util.Metadata.<init>(Metadata.java:48)
> >>>         com.hp.hpl.jena.JenaRuntime.<clinit>(JenaRuntime.java:37)
> >>>
> >>> 
> 
com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.<clinit>(RDFReaderFImpl.java:74)
> >>>
> >> com.hp.hpl.jena.rdf.model.impl.ModelCom.<clinit>(ModelCom.java:54)
> >>>
> >>> 
> com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel
> (ModelFactory.java:142)
> >>>
> >>> 
> com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel
> (ModelFactory.java:136)
> >>>         com.hp.hpl.jena.vocabulary.OWL.<clinit>(OWL.java:37)
> >>>
> >> com.hp.hpl.jena.sparql.graph.NodeConst.<clinit>(NodeConst.java:41)
> >>>
> > com.hp.hpl.jena.sparql.lang.ParserBase.<init>(ParserBase.java:55)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserQueryBase.<init>(ParserQueryBase.java:39)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.arq.ARQParserBase.<init>(ARQParserBase.java:26)
> >>> 
com.hp.hpl.jena.sparql.lang.arq.ARQParser.<init>(ARQParser.java:6613)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate._parse(ParserARQUpdate.java:62)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate.parse$(ParserARQUpdate.java:41)
> >>> com.hp.hpl.jena.sparql.lang.UpdateParser.parse(UpdateParser.java:42)
> >>> com.hp.hpl.jena.update.UpdateFactory.make(UpdateFactory.java:84)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:75)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:53)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:43)
> >>>         tester.Tester.go(Tester.java:26)
> >>>         info.resc.sandbox.GenericTest.doGet(GenericTest.java:43)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
> >>>
> >>> root cause
> >>>
> >>> java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
> >>>
> >>> 
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal
> (BundleLoader.java:467)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass
> (GeronimoClassLoader.java:85)
> >>>         java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> >>>         java.lang.ClassLoader.defineClass1(Native Method)
> >>>         java.lang.ClassLoader.defineClass(ClassLoader.java:791)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.defineClass
> (GeronimoClassLoader.java:213)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass
> (ClasspathManager.java:601)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl
> (ClasspathManager.java:567)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl
> (ClasspathManager.java:490)
> >>>
> >>> 
> 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader
> (ClasspathManager.java:478)
> >>>
> >>> 
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass
> (ClasspathManager.java:458)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.findLocalClass
> (GeronimoClassLoader.java:237)
> >>>
> >>> 
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass
> (BundleLoader.java:400)
> >>>
> >>> 
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal
> (BundleLoader.java:476)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> >>>
> >>> 
> 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> >>>
> >>> 
> org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass
> (GeronimoClassLoader.java:85)
> >>>         java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> >>>
> > org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown
> >>
> >>> Source)
> >>> org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown
> >
> >>> Source)
> >>>
> > org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown
> >>
> >>> Source)
> >>> 
org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown
> >>> Source)
> >>>         org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >>>         org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> >> Source)
> >>>         org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> >>>         org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
> >>>         org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown 
> Source)
> >>>         java.util.XMLUtils.getLoadingDoc(XMLUtils.java:102)
> >>>         java.util.XMLUtils.load(XMLUtils.java:74)
> >>>         java.util.Properties.loadFromXML(Properties.java:868)
> >>>         com.hp.hpl.jena.util.Metadata.read(Metadata.java:80)
> >>>         com.hp.hpl.jena.util.Metadata.addMetadata(Metadata.java:54)
> >>>         com.hp.hpl.jena.util.Metadata.<init>(Metadata.java:48)
> >>>         com.hp.hpl.jena.JenaRuntime.<clinit>(JenaRuntime.java:37)
> >>>
> >>> 
> 
com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.<clinit>(RDFReaderFImpl.java:74)
> >>>
> >> com.hp.hpl.jena.rdf.model.impl.ModelCom.<clinit>(ModelCom.java:54)
> >>>
> >>> 
> com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel
> (ModelFactory.java:142)
> >>>
> >>> 
> com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel
> (ModelFactory.java:136)
> >>>         com.hp.hpl.jena.vocabulary.OWL.<clinit>(OWL.java:37)
> >>>
> >> com.hp.hpl.jena.sparql.graph.NodeConst.<clinit>(NodeConst.java:41)
> >>>
> > com.hp.hpl.jena.sparql.lang.ParserBase.<init>(ParserBase.java:55)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserQueryBase.<init>(ParserQueryBase.java:39)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.arq.ARQParserBase.<init>(ARQParserBase.java:26)
> >>> 
com.hp.hpl.jena.sparql.lang.arq.ARQParser.<init>(ARQParser.java:6613)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate._parse(ParserARQUpdate.java:62)
> >>>
> >>> 
> 
com.hp.hpl.jena.sparql.lang.ParserARQUpdate.parse$(ParserARQUpdate.java:41)
> >>> com.hp.hpl.jena.sparql.lang.UpdateParser.parse(UpdateParser.java:42)
> >>> com.hp.hpl.jena.update.UpdateFactory.make(UpdateFactory.java:84)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:75)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:53)
> >>>
> >> com.hp.hpl.jena.update.UpdateFactory.create(UpdateFactory.java:43)
> >>>         tester.Tester.go(Tester.java:26)
> >>>         info.resc.sandbox.GenericTest.doGet(GenericTest.java:43)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
> >>>         javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
> >>>
> >>> Met Vriendelijke Groet / With Kind Regards
> >>> Bart van Leeuwen
> >>> @semanticfire
> >>>
> >>> ##############################################################
> >>> # netage.nl
> >>> # http://netage.nl
> >>> # Enschedepad 76
> >>> # 1324 GJ Almere
> >>> # The Netherlands
> >>> # tel. +31(0)36-5347479
> >>> ##############################################################
> >>>
> >>>
> >>
> >>
> >>
> >
> 
> 

Reply via email to