Failed to create Pellet Reasoner in Linux Ubuntu

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

Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Samuel Croset
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Timothy Redmond
In reply to this post by Andrew Ton

The usual cause for an AbstractMethodError is that the collection of jars that you have is out of sync.  In fact the documentation of the error states that

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

This suggests that the impression that "Everything runs OK in several environment" is somehow wrong and is misleading you.  Perhaps you did a clean build to do the install into Ubuntu?  Or you recently changed versions of the OWL api and/or pellet?

In this case it looks like the incompatibility is between pellet jars and the owlapi jars.

-Timothy


[1] http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html

On 10/17/2012 09:10 PM, Andrew Ton wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
In reply to this post by Samuel Croset

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,


On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Samuel Croset
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel

On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
In reply to this post by Timothy Redmond

Hi Timothy,

Thank you for your help!

I did a clean build and tested the application in another environment (MAC) and it worked. However the application still had this problem when I tested in Ubuntu. Since I never had this problem I did not update or change owlapi or pellet libraries.
Any hints are highly appreciated.

Thanks,

On Thu, Oct 18, 2012 at 6:55 AM, Timothy Redmond <[hidden email]> wrote:

The usual cause for an AbstractMethodError is that the collection of jars that you have is out of sync.  In fact the documentation of the error states that

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

This suggests that the impression that "Everything runs OK in several environment" is somehow wrong and is misleading you.  Perhaps you did a clean build to do the install into Ubuntu?  Or you recently changed versions of the OWL api and/or pellet?

In this case it looks like the incompatibility is between pellet jars and the owlapi jars.

-Timothy


[1] http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html

On 10/17/2012 09:10 PM, Andrew Ton wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
In reply to this post by Samuel Croset
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,

On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again. This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback




_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Timothy Redmond
On 10/18/2012 03:02 PM, Andrew Ton wrote:

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.

I think that the version of java and the fact that you are using ubuntu is irrelevant.  But check what I say at the end.

This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

This is again totally consistent with the exception you got before.  Your jar files are inconsistent with one another.  At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using.  In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile.  But there is a twist that occurred to me.

In my previous message I had suggested that if you had it working on windows then it should work on ubuntu.  But there is another situation that has arisen in the past.  If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform.  Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class.  I ran into this once before (a long time ago) and I don't remember all the preconditions.

So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath.  On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win.  This is a very bad situation to be in and you want to track this type of situation down and fix it. 

If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.

-Timothy






BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton

Hi Timothy,

Thank you for your explanation! 

I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.

Thanks,




On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email]> wrote:
On 10/18/2012 03:02 PM, Andrew Ton wrote:

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.

I think that the version of java and the fact that you are using ubuntu is irrelevant.  But check what I say at the end.


This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

This is again totally consistent with the exception you got before.  Your jar files are inconsistent with one another.  At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using.  In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile.  But there is a twist that occurred to me.

In my previous message I had suggested that if you had it working on windows then it should work on ubuntu.  But there is another situation that has arisen in the past.  If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform.  Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class.  I ran into this once before (a long time ago) and I don't remember all the preconditions.

So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath.  On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win.  This is a very bad situation to be in and you want to track this type of situation down and fix it. 

If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.

-Timothy







BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
Hi,

I tried several ways:

1. remove pellet-owlapiv3-2.3.2.jar: The problem still happens in Ubuntu

2. remove owlapi-bin-3.2.3.jar: has compile error

3. remove owlapi-3.0.0.jar: both Mac and Ubuntu has the same problem (AbstractMethodError)



On Thu, Oct 18, 2012 at 8:54 PM, Andrew Ton <[hidden email]> wrote:

Hi Timothy,

Thank you for your explanation! 

I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.

Thanks,




On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email]> wrote:
On 10/18/2012 03:02 PM, Andrew Ton wrote:

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.

I think that the version of java and the fact that you are using ubuntu is irrelevant.  But check what I say at the end.


This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

This is again totally consistent with the exception you got before.  Your jar files are inconsistent with one another.  At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using.  In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile.  But there is a twist that occurred to me.

In my previous message I had suggested that if you had it working on windows then it should work on ubuntu.  But there is another situation that has arisen in the past.  If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform.  Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class.  I ran into this once before (a long time ago) and I don't remember all the preconditions.

So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath.  On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win.  This is a very bad situation to be in and you want to track this type of situation down and fix it. 

If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.

-Timothy







BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback




_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Ronald Denaux
In reply to this post by Andrew Ton
On 19 October 2012 04:54, Andrew Ton <[hidden email]> wrote:
I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library.

You can use "mvn dependency:tree" to find out the source of the conflicting dependencies, that may help you decide how to resolve the issue.

Ronald

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Timothy Redmond
In reply to this post by Andrew Ton

You are now closing in on your problem but you have a little bit of digging to do.  Your end goal is to only have one owlapi jar file that is compatible with both your code (possibly after some modifications) and the pellet code.

I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu.

It looks like you have problems on all platforms but it only showed up when you ran things on ubuntu.  (This happened to me once also.)  The maven might add an extra level of complexity - once you figure out what needs to happen you will also need to figure out how to make maven cooperate.  You may also have to do a bit of extra work to find out which owlapi jar files maven is using.  I don't know if maven has tools to help.

Hi,

I tried several ways:

1. remove pellet-owlapiv3-2.3.2.jar: The problem still happens in Ubuntu

2. remove owlapi-bin-3.2.3.jar: has compile error

3. remove owlapi-3.0.0.jar: both Mac and Ubuntu has the same problem (AbstractMethodError)

I suspect at a minimum #3 has to go - it sounds a bit old.  You may want to consider going to the latest version of pellet which probably will allow you to use the latest version of the OWL api.  If this is an option I think it will make your life easier.  You may also need to modify your sources because you have been compiling against multiple versions of the OWL api.

First you need to verify which of these files are actually versions of the owl api.  I suspect that all three of these are owlapi jars but I am not positive about #1.  On a unix system you can do this with a "jar -tf" and a grep.  Here I am checking a file from my version of the pellet distribution by looking for the OWLOntology class which is part of the OWL api:

    Neptune:pellet-2.3.0% jar -tf lib/owlapiv3/owlapi-bin.jar | grep OWLOntology.class
    org/semanticweb/owlapi/model/OWLOntology.class
    Neptune:pellet-2.3.0% 

On the other hand on my distribution of pellet the OWLOntology class is not found in pellet-owlapiv3.jar:

     Neptune:pellet-2.3.0% jar -tf ./lib/pellet-owlapiv3.jar | grep OWLOntology.class
     Neptune:pellet-2.3.0% 

I believe that this file is named as it is because it is some compatibility layer for a certain version of the OWL api.

If you want something less command line oriented then you can use the fact that jar files are really zip files and some archive programs are smart enough not to get confused by the ".jar" suffix. 

You need to look around and make sure that you have found all the owlapi jar files.   If you are good with unix you can use more powerful combinations to search.  We can be a bit crude about this as follows:

    Neptune:lib% for i in *.jar
    > do 
    > jar -tf $i | grep OWLOntology.class
    > echo $i
    > done

Out of those jar files you need to figure out which ones are compatible with your version of pellet and choose one.  I believe that several versions of pellet are compatible with more than one version of the OWL api.  When you have found this version you may have to slightly modify some of your code.

It could be worse.  When I investigated this type of problem, I was a java newbie and some jar files from different projects shared different versions of the same class.  I had to make a script that would search all the jar files to figure out when two distinct jar files shared a class.

-Timothy




On Thu, Oct 18, 2012 at 8:54 PM, Andrew Ton <[hidden email]> wrote:

Hi Timothy,

Thank you for your explanation! 

I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.

Thanks,




On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email]> wrote:
On 10/18/2012 03:02 PM, Andrew Ton wrote:

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.

I think that the version of java and the fact that you are using ubuntu is irrelevant.  But check what I say at the end.


This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

This is again totally consistent with the exception you got before.  Your jar files are inconsistent with one another.  At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using.  In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile.  But there is a twist that occurred to me.

In my previous message I had suggested that if you had it working on windows then it should work on ubuntu.  But there is another situation that has arisen in the past.  If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform.  Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class.  I ran into this once before (a long time ago) and I don't remember all the preconditions.

So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath.  On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win.  This is a very bad situation to be in and you want to track this type of situation down and fix it. 

If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.

-Timothy







BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
Hi Timothy,

Thank you for your detailed message! 

I just tested my application in Windows OS and the Pellet Reasoner was successfully created. It is pretty clear to me that somehow owlapi and pellet libraries have conflicts when the app runs on Ubuntu OS.

I'll try to update all owl api and pellet libraries to see anything better. The latest version of pellet is 2.2.0, the same as mine. I'll try the latest of owl api 3.4.

Why does owl api not have maven repository? It would be more convenient to have one for OWL libraries.

Timothy, I really appreciate your help.

Cheers,


On Fri, Oct 19, 2012 at 2:09 AM, Timothy Redmond <[hidden email]> wrote:

You are now closing in on your problem but you have a little bit of digging to do.  Your end goal is to only have one owlapi jar file that is compatible with both your code (possibly after some modifications) and the pellet code.


I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu.

It looks like you have problems on all platforms but it only showed up when you ran things on ubuntu.  (This happened to me once also.)  The maven might add an extra level of complexity - once you figure out what needs to happen you will also need to figure out how to make maven cooperate.  You may also have to do a bit of extra work to find out which owlapi jar files maven is using.  I don't know if maven has tools to help.

Hi,

I tried several ways:

1. remove pellet-owlapiv3-2.3.2.jar: The problem still happens in Ubuntu

2. remove owlapi-bin-3.2.3.jar: has compile error

3. remove owlapi-3.0.0.jar: both Mac and Ubuntu has the same problem (AbstractMethodError)

I suspect at a minimum #3 has to go - it sounds a bit old.  You may want to consider going to the latest version of pellet which probably will allow you to use the latest version of the OWL api.  If this is an option I think it will make your life easier.  You may also need to modify your sources because you have been compiling against multiple versions of the OWL api.

First you need to verify which of these files are actually versions of the owl api.  I suspect that all three of these are owlapi jars but I am not positive about #1.  On a unix system you can do this with a "jar -tf" and a grep.  Here I am checking a file from my version of the pellet distribution by looking for the OWLOntology class which is part of the OWL api:

    Neptune:pellet-2.3.0% jar -tf lib/owlapiv3/owlapi-bin.jar | grep OWLOntology.class
    org/semanticweb/owlapi/model/OWLOntology.class
    Neptune:pellet-2.3.0% 

On the other hand on my distribution of pellet the OWLOntology class is not found in pellet-owlapiv3.jar:

     Neptune:pellet-2.3.0% jar -tf ./lib/pellet-owlapiv3.jar | grep OWLOntology.class
     Neptune:pellet-2.3.0% 

I believe that this file is named as it is because it is some compatibility layer for a certain version of the OWL api.

If you want something less command line oriented then you can use the fact that jar files are really zip files and some archive programs are smart enough not to get confused by the ".jar" suffix. 

You need to look around and make sure that you have found all the owlapi jar files.   If you are good with unix you can use more powerful combinations to search.  We can be a bit crude about this as follows:

    Neptune:lib% for i in *.jar
    > do 
    > jar -tf $i | grep OWLOntology.class
    > echo $i
    > done

Out of those jar files you need to figure out which ones are compatible with your version of pellet and choose one.  I believe that several versions of pellet are compatible with more than one version of the OWL api.  When you have found this version you may have to slightly modify some of your code.

It could be worse.  When I investigated this type of problem, I was a java newbie and some jar files from different projects shared different versions of the same class.  I had to make a script that would search all the jar files to figure out when two distinct jar files shared a class.

-Timothy





On Thu, Oct 18, 2012 at 8:54 PM, Andrew Ton <[hidden email]> wrote:

Hi Timothy,

Thank you for your explanation! 

I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.

Thanks,




On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email]> wrote:
On 10/18/2012 03:02 PM, Andrew Ton wrote:

Hi,

I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.

I think that the version of java and the fact that you are using ubuntu is irrelevant.  But check what I say at the end.


This time I got an exception when creating Pellet Reasoner

java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES

anyone has any idea what the problem is and how to fix it? Thank you!

This is again totally consistent with the exception you got before.  Your jar files are inconsistent with one another.  At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using.  In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile.  But there is a twist that occurred to me.

In my previous message I had suggested that if you had it working on windows then it should work on ubuntu.  But there is another situation that has arisen in the past.  If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform.  Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class.  I ran into this once before (a long time ago) and I don't remember all the preconditions.

So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath.  On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win.  This is a very bad situation to be in and you want to track this type of situation down and fix it. 

If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.

-Timothy







BR,

On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email]> wrote:
Hi Samuel,

Thank you for prompt reply!
I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?

Thanks and regards,


On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email]> wrote:
Great, this post might help you (it's for Mint but works likely the same for Ubuntu).

Cheers,

Samuel


On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email]> wrote:

Hi Samuel,

Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.

Thank you very much for your help!

Br,



On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email]> wrote:
Hi Andrew,

Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).

Hope it helps,

Samuel


On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email]> wrote:

Hello,

I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);

The exception is


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)

Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!

Thanks and regards,

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback





_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Lorenz Buehmann

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OWL API is available in the central Maven repository. And the latest Pellet version is 2.3.0.

Lorenz
On 20.10.2012 18:27, Andrew Ton wrote:
> Hi Timothy,
>
> Thank you for your detailed message!
>
> I just tested my application in Windows OS and the Pellet Reasoner was successfully created. It is pretty clear to me that somehow owlapi and pellet libraries have conflicts when the app runs on Ubuntu OS.
>
> I'll try to update all owl api and pellet libraries to see anything better. The latest version of pellet is 2.2.0, the same as mine. I'll try the latest of owl api 3.4.
>
> Why does owl api not have maven repository? It would be more convenient to have one for OWL libraries.
>
> Timothy, I really appreciate your help.
>
> Cheers,
>
>
> On Fri, Oct 19, 2012 at 2:09 AM, Timothy Redmond <[hidden email] [hidden email]> wrote:
>
>
> You are now closing in on your problem but you have a little bit of digging to do. Your end goal is to only have one owlapi jar file that is compatible with both your code (possibly after some modifications) and the pellet code.
>
>
>> I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu.
>
> It looks like you have problems on all platforms but it only showed up when you ran things on ubuntu. (This happened to me once also.) The maven might add an extra level of complexity - once you figure out what needs to happen you will also need to figure out how to make maven cooperate. You may also have to do a bit of extra work to find out which owlapi jar files maven is using. I don't know if maven has tools to help.
>
>> Hi,
>>
>> I tried several ways:
>>
>> 1. remove pellet-owlapiv3-2.3.2.jar: The problem still happens in Ubuntu
>>
>> 2. remove owlapi-bin-3.2.3.jar: has compile error
>>
>> 3. remove owlapi-3.0.0.jar: both Mac and Ubuntu has the same problem (AbstractMethodError)
>
> I suspect at a minimum #3 has to go - it sounds a bit old. You may want to consider going to the latest version of pellet which probably will allow you to use the latest version of the OWL api. If this is an option I think it will make your life easier. You may also need to modify your sources because you have been compiling against multiple versions of the OWL api.
>
> First you need to verify which of these files are actually versions of the owl api. I suspect that all three of these are owlapi jars but I am not positive about #1. On a unix system you can do this with a "jar -tf" and a grep. Here I am checking a file from my version of the pellet distribution by looking for the OWLOntology class which is part of the OWL api:
>
> Neptune:pellet-2.3.0% jar -tf lib/owlapiv3/owlapi-bin.jar | grep OWLOntology.class
> org/semanticweb/owlapi/model/OWLOntology.class
> Neptune:pellet-2.3.0%
>
>
> On the other hand on my distribution of pellet the OWLOntology class is not found in pellet-owlapiv3.jar:
>
> Neptune:pellet-2.3.0% jar -tf ./lib/pellet-owlapiv3.jar | grep OWLOntology.class
> Neptune:pellet-2.3.0%
>
> I believe that this file is named as it is because it is some compatibility layer for a certain version of the OWL api.
>
> If you want something less command line oriented then you can use the fact that jar files are really zip files and some archive programs are smart enough not to get confused by the ".jar" suffix.
>
> You need to look around and make sure that you have found all the owlapi jar files. If you are good with unix you can use more powerful combinations to search. We can be a bit crude about this as follows:
>
> Neptune:lib% for i in *.jar
> > do
> > jar -tf $i | grep OWLOntology.class
> > echo $i
> > done
>
>
> Out of those jar files you need to figure out which ones are compatible with your version of pellet and choose one. I believe that several versions of pellet are compatible with more than one version of the OWL api. When you have found this version you may have to slightly modify some of your code.
>
> It could be worse. When I investigated this type of problem, I was a java newbie and some jar files from different projects shared different versions of the same class. I had to make a script that would search all the jar files to figure out when two distinct jar files shared a class.
>
> -Timothy
>
>
>>
>>
>>
>> On Thu, Oct 18, 2012 at 8:54 PM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>
>>
>> Hi Timothy,
>>
>> Thank you for your explanation!
>>
>> I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.
>>
>> Thanks,
>>
>>
>>
>>
>> On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email] [hidden email]> wrote:
>>
>> On 10/18/2012 03:02 PM, Andrew Ton wrote:
>>>
>>> Hi,
>>>
>>> I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.
>>
>> I think that the version of java and the fact that you are using ubuntu is irrelevant. But check what I say at the end.
>>
>>
>>> This time I got an exception when creating Pellet Reasoner
>>>
>>> java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES
>>>
>>> anyone has any idea what the problem is and how to fix it? Thank you!
>>
>> This is again totally consistent with the exception you got before. Your jar files are inconsistent with one another. At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using. In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:
>>
>> Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
>>
>>
>> That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile. But there is a twist that occurred to me.
>>
>> In my previous message I had suggested that if you had it working on windows then it should work on ubuntu. But there is another situation that has arisen in the past. If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform. Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class. I ran into this once before (a long time ago) and I don't remember all the preconditions.
>>
>> So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath. On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win. This is a very bad situation to be in and you want to track this type of situation down and fix it.
>>
>> If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.
>>
>> -Timothy
>>
>>
>>
>>
>>
>>
>>>
>>> BR,
>>>
>>> On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>> Hi Samuel,
>>>
>>> Thank you for prompt reply!
>>> I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?
>>>
>>> Thanks and regards,
>>>
>>>
>>> On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email] [hidden email]> wrote:
>>>
>>> Great, this post <http://samuelcroset.com/how-install-sun-java-6-linux-mint-13> might help you (it's for Mint but works likely the same for Ubuntu).
>>>
>>> Cheers,
>>>
>>> Samuel
>>>
>>>
>>> On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>>
>>> Hi Samuel,
>>>
>>> Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
>>> It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.
>>>
>>> Thank you very much for your help!
>>>
>>> Br,
>>>
>>>
>>>
>>> On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email] [hidden email]> wrote:
>>>
>>> Hi Andrew,
>>>
>>> Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).
>>>
>>> Hope it helps,
>>>
>>> Samuel
>>>
>>>
>>> On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>>
>>> Hello,
>>>
>>> I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
>>> Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner
>>>
>>> PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
>>>
>>> The exception is
>>>
>>>
>>> java.lang.reflect.InvocationTargetException
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>> at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
>>> at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
>>> at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
>>> at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
>>> at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
>>> at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
>>> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>>> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>>> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>>> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>>> at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>>> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>>> at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>>> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>>> at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
>>> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
>>> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
>>> at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
>>> at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>>> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>>> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>>> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>>> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>>> at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>>> at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>>> at java.lang.Thread.run(Thread.java:662)
>>> Caused by: java.lang.AbstractMethodError
>>> at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)
>>>
>>> Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!
>>>
>>> Thanks and regards,
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>
>>
>> _______________________________________________
>> p4-feedback mailing list
>> [hidden email] [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>
>>
>>
>>
>>
>> _______________________________________________
>> p4-feedback mailing list
>> [hidden email] [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
>
> _______________________________________________
> p4-feedback mailing list
> [hidden email] [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
>
>
>
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQgtbEAAoJEI97YhPimK8ypqsIAJPwc8t+5uVQ5076Fr4Is+15
DitFnwBlLqlOcbswE2aSFAmuX3lzBcr16IK95BiT7PYjo8t+cSbVT/H4XKtfUMrI
WUac2znoROqEl8rTPIiZsOZ5Xb0u1yKvz7DJzvMM6UHRcHp/Qe5/xLAdb29qFsJf
WMmeB+nioR8R4slMFZqOSuEARDkwBOyfodrYezxEwlZR/zV1dIZTqKwa/a3FL9F+
nQIOnUl+l9K+PS3yh+dSTQ+5h7amJLuCzOO28f3JL+JTqTGO9r8g6vAfxMC6Gn/X
LTDlygr8+fFcys4rpfn20s2XNpad7TFCkFibj+N34gM5Iat8Kf0LEVD8fEYiV0c=
=GZNA
-----END PGP SIGNATURE-----


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
Hi,

I have used the Pellet 2.3.0. 

Inside the Pellet 2.3.0 package, there are owlapi and owlapiv3. Besides owlapiv3 was built later than owlapi, can somebody please tell me what differences between these 2 packages?

I have tried owlapi 3.2.3 and 3.4 downloaded separately, and also owlapiv3 package included in the Pellet 2.3.0. The same thing happened in all 3 cases: Failed to create Pellet Reasoner in Ubuntu.

Thanks,


On Sat, Oct 20, 2012 at 9:52 AM, Lorenz Buehmann <[hidden email]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OWL API is available in the central Maven repository. And the latest Pellet version is 2.3.0.

Lorenz

On 20.10.2012 18:27, Andrew Ton wrote:
> Hi Timothy,
>

> Thank you for your detailed message!
>
> I just tested my application in Windows OS and the Pellet Reasoner was successfully created. It is pretty clear to me that somehow owlapi and pellet libraries have conflicts when the app runs on Ubuntu OS.
>
> I'll try to update all owl api and pellet libraries to see anything better. The latest version of pellet is 2.2.0, the same as mine. I'll try the latest of owl api 3.4.
>
> Why does owl api not have maven repository? It would be more convenient to have one for OWL libraries.
>
> Timothy, I really appreciate your help.
>
> Cheers,
>
>
> On Fri, Oct 19, 2012 at 2:09 AM, Timothy Redmond <[hidden email] [hidden email]> wrote:
>
>
> You are now closing in on your problem but you have a little bit of digging to do. Your end goal is to only have one owlapi jar file that is compatible with both your code (possibly after some modifications) and the pellet code.
>
>
>> I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu.
>
> It looks like you have problems on all platforms but it only showed up when you ran things on ubuntu. (This happened to me once also.) The maven might add an extra level of complexity - once you figure out what needs to happen you will also need to figure out how to make maven cooperate. You may also have to do a bit of extra work to find out which owlapi jar files maven is using. I don't know if maven has tools to help.
>
>> Hi,
>>
>> I tried several ways:
>>
>> 1. remove pellet-owlapiv3-2.3.2.jar: The problem still happens in Ubuntu
>>
>> 2. remove owlapi-bin-3.2.3.jar: has compile error
>>
>> 3. remove owlapi-3.0.0.jar: both Mac and Ubuntu has the same problem (AbstractMethodError)
>
> I suspect at a minimum #3 has to go - it sounds a bit old. You may want to consider going to the latest version of pellet which probably will allow you to use the latest version of the OWL api. If this is an option I think it will make your life easier. You may also need to modify your sources because you have been compiling against multiple versions of the OWL api.
>
> First you need to verify which of these files are actually versions of the owl api. I suspect that all three of these are owlapi jars but I am not positive about #1. On a unix system you can do this with a "jar -tf" and a grep. Here I am checking a file from my version of the pellet distribution by looking for the OWLOntology class which is part of the OWL api:
>
> Neptune:pellet-2.3.0% jar -tf lib/owlapiv3/owlapi-bin.jar | grep OWLOntology.class
> org/semanticweb/owlapi/model/OWLOntology.class
> Neptune:pellet-2.3.0%
>
>
> On the other hand on my distribution of pellet the OWLOntology class is not found in pellet-owlapiv3.jar:
>
> Neptune:pellet-2.3.0% jar -tf ./lib/pellet-owlapiv3.jar | grep OWLOntology.class
> Neptune:pellet-2.3.0%
>
> I believe that this file is named as it is because it is some compatibility layer for a certain version of the OWL api.
>
> If you want something less command line oriented then you can use the fact that jar files are really zip files and some archive programs are smart enough not to get confused by the ".jar" suffix.
>
> You need to look around and make sure that you have found all the owlapi jar files. If you are good with unix you can use more powerful combinations to search. We can be a bit crude about this as follows:
>
> Neptune:lib% for i in *.jar
> > do
> > jar -tf $i | grep OWLOntology.class
> > echo $i
> > done
>
>
> Out of those jar files you need to figure out which ones are compatible with your version of pellet and choose one. I believe that several versions of pellet are compatible with more than one version of the OWL api. When you have found this version you may have to slightly modify some of your code.
>
> It could be worse. When I investigated this type of problem, I was a java newbie and some jar files from different projects shared different versions of the same class. I had to make a script that would search all the jar files to figure out when two distinct jar files shared a class.
>
> -Timothy
>
>
>>
>>
>>
>> On Thu, Oct 18, 2012 at 8:54 PM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>
>>
>> Hi Timothy,
>>
>> Thank you for your explanation!
>>
>> I look into my project that is built by maven. It has pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar. The pom.xml just has owlapi-bin-3.2.3 but not owlapi-3.0.0. I don't know why owlapi-3.0.0.jar is in my project, maybe it is included as dependent of other library. BTW, I have run my app without any problems in MAC and Linux systems. I only have this exception when I start trying it in a new Ubuntu. What you said makes sense to me but I still don't know to fix this problem.
>>
>> Thanks,
>>
>>
>>
>>
>> On Thu, Oct 18, 2012 at 7:06 PM, Timothy Redmond <[hidden email] [hidden email]> wrote:
>>
>> On 10/18/2012 03:02 PM, Andrew Ton wrote:
>>>
>>> Hi,
>>>
>>> I have cleaned the environment and reinstall java by running sudo apt-get install openjdk-6-jdk. The jvm in the environment now is 1.6.0-24. Then I ran the app again.
>>
>> I think that the version of java and the fact that you are using ubuntu is irrelevant. But check what I say at the end.
>>
>>
>>> This time I got an exception when creating Pellet Reasoner
>>>
>>> java.lang.NoSuchFieldError: IGNORE_ANNOTATION_CLASSES
>>>
>>> anyone has any idea what the problem is and how to fix it? Thank you!
>>
>> This is again totally consistent with the exception you got before. Your jar files are inconsistent with one another. At a guess based on your previous exception, your version of the pellet jar is incompatible with the version of the owlapi jar file that you are using. In particular if you look at the javadoc for NoSuchFieldError [1] you see that it says:
>>
>> Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
>>
>>
>> That means that if you compile all your sources (e.g. the owlapi and pellet ones also) you will find that something doesn't compile. But there is a twist that occurred to me.
>>
>> In my previous message I had suggested that if you had it working on windows then it should work on ubuntu. But there is another situation that has arisen in the past. If some of your classes occur multiple times in the class path with different versions then it is possible for an application to behave differently on one platform than on another platform. Depending on how you start the program, I don't know the precise factors, you may end up loading different versions of the same class. I ran into this once before (a long time ago) and I don't remember all the preconditions.
>>
>> So, guessing and going out on a limb, perhaps you have two versions of the owlapi on the classpath. On windows one version of the owlapi will win and on ubuntu, perhaps, a different version will win. This is a very bad situation to be in and you want to track this type of situation down and fix it.
>>
>> If you really want to run different versions of the same library in your application then - you are probably in trouble but - you should use something like OSGi that will give you powerful and intelligent controls over class loading.
>>
>> -Timothy
>>
>>
>>
>>
>>
>>
>>>
>>> BR,
>>>
>>> On Thu, Oct 18, 2012 at 9:44 AM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>> Hi Samuel,
>>>
>>> Thank you for prompt reply!
>>> I did very similar way with the instructions in your post by using the command git clone. I did not run the command apt-get purge sun-java and update-alternatives. Although my Ubuntu has only one java-6-sun I still run update-alternatives to be sure. However the problem still happens. Any hints?
>>>
>>> Thanks and regards,
>>>
>>>
>>> On Thu, Oct 18, 2012 at 8:10 AM, Samuel Croset <[hidden email] [hidden email]> wrote:
>>>
>>> Great, this post <http://samuelcroset.com/how-install-sun-java-6-linux-mint-13> might help you (it's for Mint but works likely the same for Ubuntu).
>>>
>>> Cheers,
>>>
>>> Samuel

>>>
>>>
>>> On Thu, Oct 18, 2012 at 3:57 PM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>>
>>> Hi Samuel,
>>>
>>> Actually when I installed Ubuntu 12.04 and I'm not familiar with Ubuntu I got the java6 from oab-java6 using the git clone command. Then I ran the command apt-get install sun-java6-plugin sun-java6-jre sun-java6-bin.
>>> It seemed to me that the JVM in this Ubuntu was the cause of the problem. Maybe I have to redo everything.
>>>
>>> Thank you very much for your help!
>>>
>>> Br,
>>>
>>>
>>>
>>> On Thu, Oct 18, 2012 at 2:15 AM, Samuel Croset <[hidden email] [hidden email]> wrote:
>>>
>>> Hi Andrew,
>>>
>>> Problems like this can sometimes occur if you use the OpenJDK (shipped by default on Ubuntu) instead of the Sun one (it seems that a "sun" class is missing).
>>>
>>> Hope it helps,
>>>
>>> Samuel
>>>
>>>
>>> On Thu, Oct 18, 2012 at 5:10 AM, Andrew Ton <[hidden email] [hidden email]> wrote:
>>>
>>>
>>> Hello,
>>>
>>> I'm using OWL API 3.2.3 and Pellet 2.2.0 in our project. Everything runs OK in several environment (local, public servers)
>>> Recently I have deployed the project to a Linux Ubuntu that has JVM 1.6.0.35. There is a problem when creating Pellet Reasoner
>>>
>>> PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
>>>
>>> The exception is
>>>
>>>
>>> java.lang.reflect.InvocationTargetException
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>> at org.restlet.ext.servlet.ServerServlet.createApplication(ServerServlet.java:367)
>>> at org.restlet.ext.servlet.ServerServlet.getApplication(ServerServlet.java:772)
>>> at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:508)
>>> at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:915)
>>> at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
>>> at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
>>> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>>> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>>> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>>> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>>> at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>>> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>>> at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>>> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>>> at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
>>> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
>>> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
>>> at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
>>> at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
>>> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
>>> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>>> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>>> at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
>>> at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>>> at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>>> at java.lang.Thread.run(Thread.java:662)
>>> Caused by: java.lang.AbstractMethodError
>>> at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLDataHasValueImpl.accept(OWLDataHasValueImpl.java:102)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:522)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:139)
>>> at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:698)
>>> at uk.ac.manchester.cs.owl.owlapi.OWLOntologyImpl.accept(OWLOntologyImpl.java:1413)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.refresh(PelletReasoner.java:959)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:332)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasoner.<init>(PelletReasoner.java:291)
>>> at com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory.createReasoner(PelletReasonerFactory.java:61)
>>>
>>> Can somebody gives some hint why the problem happens and how to fix it. Very appreciate it!
>>>
>>> Thanks and regards,
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]

>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]

>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]

>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]

>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email] [hidden email]

>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>
>>
>> _______________________________________________
>> p4-feedback mailing list
>> [hidden email] [hidden email]

>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>>
>>
>>
>>
>>
>> _______________________________________________
>> p4-feedback mailing list
>> [hidden email] [hidden email]

>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
>
> _______________________________________________
> p4-feedback mailing list
> [hidden email] [hidden email]

> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
>
>
>
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQgtbEAAoJEI97YhPimK8ypqsIAJPwc8t+5uVQ5076Fr4Is+15
DitFnwBlLqlOcbswE2aSFAmuX3lzBcr16IK95BiT7PYjo8t+cSbVT/H4XKtfUMrI
WUac2znoROqEl8rTPIiZsOZ5Xb0u1yKvz7DJzvMM6UHRcHp/Qe5/xLAdb29qFsJf
WMmeB+nioR8R4slMFZqOSuEARDkwBOyfodrYezxEwlZR/zV1dIZTqKwa/a3FL9F+
nQIOnUl+l9K+PS3yh+dSTQ+5h7amJLuCzOO28f3JL+JTqTGO9r8g6vAfxMC6Gn/X
LTDlygr8+fFcys4rpfn20s2XNpad7TFCkFibj+N34gM5Iat8Kf0LEVD8fEYiV0c=
=GZNA
-----END PGP SIGNATURE-----


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Ronald Denaux
Hi Andrew,

Several questions, remaks and suggestions:

1. why is this being discussed in p4-feedback? The issue is related only to pellet and owlapi. So http://lists.owldl.com/mailman/listinfo/pellet-users/
and https://lists.sourceforge.net/lists/listinfo/owlapi-developer would be better places to get help

2. Trying owlapi versions at random will not achieve much. You need to figure out which library versions are conflicting in order to decide a course of action. Since you are using maven, "mvn dependency:tree" will print a nice overview of all your dependencies, showing why you are ending up with 3 conflicting versions of the owlapi (pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar). Can you post the result of the dependency tree? That may help us figure out a solution. (Alternatively, if you' re using a recent version of  Eclipse, which has built-in support for maven; when you open the pom file, there is a tab showing the "Dependency Hierarchy". A screenshot of this view will be just as helpful).

3. The official pellet-2.3.0 distribution (from Clark&Parsia) seems to be built against a patched version of OWL API (for OWL 2.0), Release 3.1.0 (+ PlainLiteral.patch applied). This may explain why the stacktrace you got failed when handling literals:
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)

4. Assuming you are indeed using pellet-2.3.0 (initially you said you were using 2.2.0), where did you get it and how did you add it to your maven repository. I couldn't  find an official maven repo for pellet. The fact that you are getting unwanted dependencies suggests that you are using one of many unofficial maven repos that have a version of pellet. E.g. http://maven.aksw.org/archiva/repository/internal/com/owldl/pellet/2.3.0/
You may need to inspect the jars and poms to make sure you know what you are getting from such a repo.

5. Pellet-2.3.0 was released more than a year ago. The owlapi has had various updates since version 3.1.0. I don't know whether recent owlapi versions are compatible with 3.1.0 (+ PlainLiteral.patch), but it doesn' t look like it. So you need to decide:
  + stick with Pellet-2.3.0 and use their version of the owlapi for all of your code or 
  + use a different reasoner (e.g. HermiT) which is compatible with more recent versions of the owlapi or
  + as Timothy suggested, go for a more complex solution with OSGi to mix and match different versions (not recommended unless you know what you are doing).

Cheers,
Ronald


On 20 October 2012 22:03, Andrew Ton <[hidden email]> wrote:
Hi,

I have used the Pellet 2.3.0. 

Inside the Pellet 2.3.0 package, there are owlapi and owlapiv3. Besides owlapiv3 was built later than owlapi, can somebody please tell me what differences between these 2 packages?

I have tried owlapi 3.2.3 and 3.4 downloaded separately, and also owlapiv3 package included in the Pellet 2.3.0. The same thing happened in all 3 cases: Failed to create Pellet Reasoner in Ubuntu.

Thanks,


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Timothy Redmond

This all sounds like really good advice so I would recommend  studying and following this reply carefully with a couple of tweaks.

First of the lists I would recommend the pellet one (http://lists.owldl.com/mailman/listinfo/pellet-users/) as this requires some pellet specific knowledge.  In a couple of cases I was out of my depth regarding pellet issues.

  + as Timothy suggested, go for a more complex solution with OSGi to mix and match different versions (not recommended unless you know what you are doing).

I would only recommend this if you obtain a truly in depth knowledge of what is going wrong and realize that you really must have two versions of the OWL api in your application to make it work.  This would introduce some complexity and you would have to understand your class loader structure really well in order to make this work.   In particular this approach will generate classes that have the same name but which are incompatible.  At first glance it would seem unlikely that you really need to go this route - it is very complicated.

-Timothy





On 10/20/2012 03:41 PM, Ronald Denaux wrote:
Hi Andrew,

Several questions, remaks and suggestions:

1. why is this being discussed in p4-feedback? The issue is related only to pellet and owlapi. So http://lists.owldl.com/mailman/listinfo/pellet-users/
and https://lists.sourceforge.net/lists/listinfo/owlapi-developer would be better places to get help

2. Trying owlapi versions at random will not achieve much. You need to figure out which library versions are conflicting in order to decide a course of action. Since you are using maven, "mvn dependency:tree" will print a nice overview of all your dependencies, showing why you are ending up with 3 conflicting versions of the owlapi (pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar). Can you post the result of the dependency tree? That may help us figure out a solution. (Alternatively, if you' re using a recent version of  Eclipse, which has built-in support for maven; when you open the pom file, there is a tab showing the "Dependency Hierarchy". A screenshot of this view will be just as helpful).

3. The official pellet-2.3.0 distribution (from Clark&Parsia) seems to be built against a patched version of OWL API (for OWL 2.0), Release 3.1.0 (+ PlainLiteral.patch applied). This may explain why the stacktrace you got failed when handling literals:
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)

4. Assuming you are indeed using pellet-2.3.0 (initially you said you were using 2.2.0), where did you get it and how did you add it to your maven repository. I couldn't  find an official maven repo for pellet. The fact that you are getting unwanted dependencies suggests that you are using one of many unofficial maven repos that have a version of pellet. E.g. http://maven.aksw.org/archiva/repository/internal/com/owldl/pellet/2.3.0/
You may need to inspect the jars and poms to make sure you know what you are getting from such a repo.

5. Pellet-2.3.0 was released more than a year ago. The owlapi has had various updates since version 3.1.0. I don't know whether recent owlapi versions are compatible with 3.1.0 (+ PlainLiteral.patch), but it doesn' t look like it. So you need to decide:
  + stick with Pellet-2.3.0 and use their version of the owlapi for all of your code or 
  + use a different reasoner (e.g. HermiT) which is compatible with more recent versions of the owlapi or
  + as Timothy suggested, go for a more complex solution with OSGi to mix and match different versions (not recommended unless you know what you are doing).

Cheers,
Ronald


On 20 October 2012 22:03, Andrew Ton <[hidden email]> wrote:
Hi,

I have used the Pellet 2.3.0. 

Inside the Pellet 2.3.0 package, there are owlapi and owlapiv3. Besides owlapiv3 was built later than owlapi, can somebody please tell me what differences between these 2 packages?

I have tried owlapi 3.2.3 and 3.4 downloaded separately, and also owlapiv3 package included in the Pellet 2.3.0. The same thing happened in all 3 cases: Failed to create Pellet Reasoner in Ubuntu.

Thanks,



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Failed to create Pellet Reasoner in Linux Ubuntu

Andrew Ton
In reply to this post by Ronald Denaux
Hi Ronal and Timothy,

First of all I'd like to thank both of you for your suggestions and explanations! 

1) Thank you for your suggestions. Because I have not registered to pellet-users and owlapi-developer I posted my questions here. But I will post questions in correct sites for better results.

2) Good news is my app now is able to create the reasoner without exception. The problem was in my pom.xml I had com.owldl.pellet-2.2.0 but other pellet libraries were from the package pellet 2.3.0 (pellet-core, pellet-datatypes...). Somehow I did not update the version of com.owldl.pellet to 2.3.0 and the owlapi-3.0.0 dependency was downloaded into my application and it caused conflicts. I paid a dear price for this mistake :)  After I update com.owldl.pellet to 2.3.0 the unwanted owlapi 3.0.0 disappears and the reasoner is created successfully in Ubuntu.

3) Thanks for sharing this information.

4) I have downloaded pellet packages from http://clarkparsia.com/pellet/download and I have to install its libraries manually to my repository using maven install command. It would be great if Pellet has a public maven repository.

5) I prefer to make thing simple, using all libraries come with the pellet 2.3.0 package is my choice in my application.

So far I'm happy seeing the exception gone and thank you both so much for your help!

Cheers,
Andrew




On Sat, Oct 20, 2012 at 3:41 PM, Ronald Denaux <[hidden email]> wrote:
Hi Andrew,

Several questions, remaks and suggestions:

1. why is this being discussed in p4-feedback? The issue is related only to pellet and owlapi. So http://lists.owldl.com/mailman/listinfo/pellet-users/
and https://lists.sourceforge.net/lists/listinfo/owlapi-developer would be better places to get help

2. Trying owlapi versions at random will not achieve much. You need to figure out which library versions are conflicting in order to decide a course of action. Since you are using maven, "mvn dependency:tree" will print a nice overview of all your dependencies, showing why you are ending up with 3 conflicting versions of the owlapi (pellet-owlapiv3-2.3.2.jar, owlapi-bin-3.2.3.jar, and owlapi-3.0.0.jar). Can you post the result of the dependency tree? That may help us figure out a solution. (Alternatively, if you' re using a recent version of  Eclipse, which has built-in support for maven; when you open the pom file, there is a tab showing the "Dependency Hierarchy". A screenshot of this view will be just as helpful).

3. The official pellet-2.3.0 distribution (from Clark&Parsia) seems to be built against a patched version of OWL API (for OWL 2.0), Release 3.1.0 (+ PlainLiteral.patch applied). This may explain why the stacktrace you got failed when handling literals:
Caused by: java.lang.AbstractMethodError
at uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl.accept(OWLLiteralImpl.java:193)
at com.clarkparsia.pellet.owlapiv3.PelletVisitor.visit(PelletVisitor.java:680)

4. Assuming you are indeed using pellet-2.3.0 (initially you said you were using 2.2.0), where did you get it and how did you add it to your maven repository. I couldn't  find an official maven repo for pellet. The fact that you are getting unwanted dependencies suggests that you are using one of many unofficial maven repos that have a version of pellet. E.g. http://maven.aksw.org/archiva/repository/internal/com/owldl/pellet/2.3.0/
You may need to inspect the jars and poms to make sure you know what you are getting from such a repo.

5. Pellet-2.3.0 was released more than a year ago. The owlapi has had various updates since version 3.1.0. I don't know whether recent owlapi versions are compatible with 3.1.0 (+ PlainLiteral.patch), but it doesn' t look like it. So you need to decide:
  + stick with Pellet-2.3.0 and use their version of the owlapi for all of your code or 
  + use a different reasoner (e.g. HermiT) which is compatible with more recent versions of the owlapi or
  + as Timothy suggested, go for a more complex solution with OSGi to mix and match different versions (not recommended unless you know what you are doing).

Cheers,
Ronald


On 20 October 2012 22:03, Andrew Ton <[hidden email]> wrote:
Hi,

I have used the Pellet 2.3.0. 

Inside the Pellet 2.3.0 package, there are owlapi and owlapiv3. Besides owlapiv3 was built later than owlapi, can somebody please tell me what differences between these 2 packages?

I have tried owlapi 3.2.3 and 3.4 downloaded separately, and also owlapiv3 package included in the Pellet 2.3.0. The same thing happened in all 3 cases: Failed to create Pellet Reasoner in Ubuntu.

Thanks,


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback