You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@marmotta.apache.org by Andrea Di Menna <ni...@gmail.com> on 2013/11/22 16:26:10 UTC

Cannot run Marmotta war with Java 7 (51.0)

Hello all,

I just downloaded apache-marmotta-3.1.0-incubating-webapp.zip from the
website and deployed it on a Tomcat 6.0 instance.

I am getting the following error:

SEVERE: Error deploying web application archive marmotta.war
java.lang.UnsupportedClassVersionError:
org/apache/marmotta/platform/core/jndi/MarmottaJndiListener : Unsupported
major.minor version 51.0 (unable to load class
org.apache.marmotta.platform.core.jndi.MarmottaJndiListener)
at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2822)
at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at
org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:145)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:73)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:56)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1078)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4612)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Which Java version have you used to build it?

Regards
Andrea

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Sergio Fernández <se...@salzburgresearch.at>.
On 25/11/13 11:19, Andrea Di Menna wrote:
> Thanks Sergio.
> After changing the properties you mention everything works as expected :-)

Great! :-)

As a lateral lesson you should learn (and all users reading this), those 
are the values you'd need to change when moving the server to a new 
environment, production, testing or whatever.

Due obvious conflict with the core principles, you can imagine it's not 
common that a "Linked Data Server" would move to a new URI. But at least 
that's how we are trying to address such problematic for the development 
lifecycle.

Cheers,

-- 
Sergio Fernández
Senior Researcher
Knowledge and Media Technologies
Salzburg Research Forschungsgesellschaft mbH
Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
T: +43 662 2288 318 | M: +43 660 2747 925
sergio.fernandez@salzburgresearch.at
http://www.salzburgresearch.at

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Andrea Di Menna <ni...@gmail.com>.
Thanks Sergio.

After changing the properties you mention everything works as expected :-)

Thanks!
Cheers
Andrea


2013/11/25 Sergio Fernández <se...@salzburgresearch.at>

> On 25/11/13 10:21, Andrea Di Menna wrote:
>
>> Resource is reachable at URI http://localhost:8080/core/admin/about.html
>>
>
> That's the expected URL where access Marmotta running the webapp launched
> with Maven, right.
>
>
>  But whenever I click on any internal link on the web page a resource in
>> the
>> http://localhost:8080/marmotta-webapp/  context is asked.
>> That fails.
>>
>
> Works fine for me...
>
> The only think that I can imagine, it's a wrong setting. Marmotta
> registers the base URL with the first request. Check at your
> /tmp/marmotta/system-config.properties. In that files there are two
> values particularly interesting for you for solving this issue:
>
>  * 'kiwi.context' is the base URI for cresting resources' URIs
>  * 'kiwi.host' is the base URL where Mamotta is running
>
> This last one is used to create all links in the admin ui. Check the value
> it has, please.
>
> If you do not have any particular data in Marmotta and you could remove
> the home directory, there is a Maven profile to force cleaning-up the home
> directory at booting:
>
>   mvn clean tomcat7:run -Pcleanall
>
> Hope this helps.
>
> Cheers,
>
>
> --
> Sergio Fernández
> Senior Researcher
> Knowledge and Media Technologies
> Salzburg Research Forschungsgesellschaft mbH
> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
> T: +43 662 2288 318 | M: +43 660 2747 925
> sergio.fernandez@salzburgresearch.at
> http://www.salzburgresearch.at
>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Sergio Fernández <se...@salzburgresearch.at>.
On 25/11/13 10:21, Andrea Di Menna wrote:
> Resource is reachable at URI http://localhost:8080/core/admin/about.html

That's the expected URL where access Marmotta running the webapp 
launched with Maven, right.

> But whenever I click on any internal link on the web page a resource in the
> http://localhost:8080/marmotta-webapp/  context is asked.
> That fails.

Works fine for me...

The only think that I can imagine, it's a wrong setting. Marmotta 
registers the base URL with the first request. Check at your 
/tmp/marmotta/system-config.properties. In that files there are two 
values particularly interesting for you for solving this issue:

  * 'kiwi.context' is the base URI for cresting resources' URIs
  * 'kiwi.host' is the base URL where Mamotta is running

This last one is used to create all links in the admin ui. Check the 
value it has, please.

If you do not have any particular data in Marmotta and you could remove 
the home directory, there is a Maven profile to force cleaning-up the 
home directory at booting:

   mvn clean tomcat7:run -Pcleanall

Hope this helps.

Cheers,

-- 
Sergio Fernández
Senior Researcher
Knowledge and Media Technologies
Salzburg Research Forschungsgesellschaft mbH
Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
T: +43 662 2288 318 | M: +43 660 2747 925
sergio.fernandez@salzburgresearch.at
http://www.salzburgresearch.at

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Andrea Di Menna <ni...@gmail.com>.
Hi all,

The tomcat 7 plugin used in marmotta loads Tomcat 7.0.37 (which should be
ok).
Anyway, when I run
~/marmotta/launchers/marmotta-webapp$  mvn tomcat7:run
I get nothing out of
http://localhost:8080/marmotta-webapp/core/admin/about.html

Resource is reachable at URU http://localhost:8080/core/admin/about.html

But whenever I click on any internal link on the web page a resource in the
http://localhost:8080/marmotta-webapp/ context is asked.
That fails.

The only way for me to make it work is to change the tomcat context in
pom.xml

diff --git a/launchers/marmotta-webapp/pom.xml
b/launchers/marmotta-webapp/pom.xml
index 60d6f86..bf92123 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -35,7 +35,7 @@
     <properties>
         <!-- these are used for the goals tomcat6/7:run or jetty:run -->
         <marmotta.home>/tmp/marmotta</marmotta.home>
-        <marmotta.context>/</marmotta.context>
+        <marmotta.context>/marmotta-webapp</marmotta.context>
         <marmotta.port>8080</marmotta.port>
     </properties>

Is this happening to me only?

Cheers
Andrea


2013/11/25 Andrea Di Menna <ni...@gmail.com>

> Hi Raffaele,
> I was running marmotta with Tomcat 7 maven plugin from the launcher-webapp
> folder (which should use a compatible version - i.e. > 7.0.30)
> I am going to check today which version of tomcat it runs.
> Thanks
> Andrea
> Il 23/nov/2013 17:12 "Raffaele Palmieri" <ra...@gmail.com> ha
> scritto:
>
> Hi Andrea,
>> what version of Tomcat 7 do you use? You should use versions >= 7.0.30.
>> Give a look to the following issue:
>> https://issues.apache.org/jira/browse/MARMOTTA-224 , there you can find
>> the same problem.
>> Cheers,
>> Raffaele.
>>
>>
>> On 23 November 2013 16:59, Andrea Di Menna <ni...@gmail.com> wrote:
>>
>>> I am sorry to bug you again :(
>>> Yesterday I was trying Marmotta but had the following problems which I
>>> am not able to resolve yet:
>>> - deployed the marmotta war (downloaded from the website) on a Tomcat 6
>>> installation:  the webui was showing up but some functionalities were not
>>> available due to missing jQuery and other JavaScript libraries
>>> - after that I cloned the git repo and compiled marmotta following
>>> instructions on the website. Run the war using Tomcat 7 maven plugin but
>>> marmotta webui was not showing up (jquery and stuff were available though)
>>>
>>> As far as I understood the problems with Tomcat 6 were due to
>>> incompatibilities between webjars packaging and servlet < 3.0
>>> Problems with Tomcat 7 should be due to incompatibilities between
>>> packaging of marmotta-core webapp and the way the war is built (all the jar
>>> dependencies are added to WEB-INF/lib but marmotta-core has resources
>>> outside of the resources dir).
>>>
>>> What I am doing wrong?
>>> Thanks a lot.
>>> Andrea
>>> Il 22/nov/2013 16:54 "Sergio Fernández" <
>>> sergio.fernandez@salzburgresearch.at> ha scritto:
>>>
>>> Hi,
>>>>
>>>> On 22/11/13 16:52, Andrea Di Menna wrote:
>>>>
>>>>> The problem was that JAVA_HOME was not set and it was commented out in
>>>>> /etc/default/tomcat6
>>>>> Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.
>>>>>
>>>>> I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and
>>>>> everything is
>>>>> working fine.
>>>>>
>>>>
>>>> I knew should be something like that... great! issue solved
>>>>
>>>> --
>>>> Sergio Fernández
>>>> Senior Researcher
>>>> Knowledge and Media Technologies
>>>> Salzburg Research Forschungsgesellschaft mbH
>>>> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
>>>> T: +43 662 2288 318 | M: +43 660 2747 925
>>>> sergio.fernandez@salzburgresearch.at
>>>> http://www.salzburgresearch.at
>>>>
>>>
>>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Andrea Di Menna <ni...@gmail.com>.
Hi Raffaele,
I was running marmotta with Tomcat 7 maven plugin from the launcher-webapp
folder (which should use a compatible version - i.e. > 7.0.30)
I am going to check today which version of tomcat it runs.
Thanks
Andrea
Il 23/nov/2013 17:12 "Raffaele Palmieri" <ra...@gmail.com> ha
scritto:

> Hi Andrea,
> what version of Tomcat 7 do you use? You should use versions >= 7.0.30.
> Give a look to the following issue:
> https://issues.apache.org/jira/browse/MARMOTTA-224 , there you can find
> the same problem.
> Cheers,
> Raffaele.
>
>
> On 23 November 2013 16:59, Andrea Di Menna <ni...@gmail.com> wrote:
>
>> I am sorry to bug you again :(
>> Yesterday I was trying Marmotta but had the following problems which I am
>> not able to resolve yet:
>> - deployed the marmotta war (downloaded from the website) on a Tomcat 6
>> installation:  the webui was showing up but some functionalities were not
>> available due to missing jQuery and other JavaScript libraries
>> - after that I cloned the git repo and compiled marmotta following
>> instructions on the website. Run the war using Tomcat 7 maven plugin but
>> marmotta webui was not showing up (jquery and stuff were available though)
>>
>> As far as I understood the problems with Tomcat 6 were due to
>> incompatibilities between webjars packaging and servlet < 3.0
>> Problems with Tomcat 7 should be due to incompatibilities between
>> packaging of marmotta-core webapp and the way the war is built (all the jar
>> dependencies are added to WEB-INF/lib but marmotta-core has resources
>> outside of the resources dir).
>>
>> What I am doing wrong?
>> Thanks a lot.
>> Andrea
>> Il 22/nov/2013 16:54 "Sergio Fernández" <
>> sergio.fernandez@salzburgresearch.at> ha scritto:
>>
>> Hi,
>>>
>>> On 22/11/13 16:52, Andrea Di Menna wrote:
>>>
>>>> The problem was that JAVA_HOME was not set and it was commented out in
>>>> /etc/default/tomcat6
>>>> Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.
>>>>
>>>> I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and
>>>> everything is
>>>> working fine.
>>>>
>>>
>>> I knew should be something like that... great! issue solved
>>>
>>> --
>>> Sergio Fernández
>>> Senior Researcher
>>> Knowledge and Media Technologies
>>> Salzburg Research Forschungsgesellschaft mbH
>>> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
>>> T: +43 662 2288 318 | M: +43 660 2747 925
>>> sergio.fernandez@salzburgresearch.at
>>> http://www.salzburgresearch.at
>>>
>>
>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Raffaele Palmieri <ra...@gmail.com>.
Hi Andrea,
what version of Tomcat 7 do you use? You should use versions >= 7.0.30.
Give a look to the following issue:
https://issues.apache.org/jira/browse/MARMOTTA-224 , there you can find the
same problem.
Cheers,
Raffaele.


On 23 November 2013 16:59, Andrea Di Menna <ni...@gmail.com> wrote:

> I am sorry to bug you again :(
> Yesterday I was trying Marmotta but had the following problems which I am
> not able to resolve yet:
> - deployed the marmotta war (downloaded from the website) on a Tomcat 6
> installation:  the webui was showing up but some functionalities were not
> available due to missing jQuery and other JavaScript libraries
> - after that I cloned the git repo and compiled marmotta following
> instructions on the website. Run the war using Tomcat 7 maven plugin but
> marmotta webui was not showing up (jquery and stuff were available though)
>
> As far as I understood the problems with Tomcat 6 were due to
> incompatibilities between webjars packaging and servlet < 3.0
> Problems with Tomcat 7 should be due to incompatibilities between
> packaging of marmotta-core webapp and the way the war is built (all the jar
> dependencies are added to WEB-INF/lib but marmotta-core has resources
> outside of the resources dir).
>
> What I am doing wrong?
> Thanks a lot.
> Andrea
> Il 22/nov/2013 16:54 "Sergio Fernández" <
> sergio.fernandez@salzburgresearch.at> ha scritto:
>
> Hi,
>>
>> On 22/11/13 16:52, Andrea Di Menna wrote:
>>
>>> The problem was that JAVA_HOME was not set and it was commented out in
>>> /etc/default/tomcat6
>>> Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.
>>>
>>> I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and everything
>>> is
>>> working fine.
>>>
>>
>> I knew should be something like that... great! issue solved
>>
>> --
>> Sergio Fernández
>> Senior Researcher
>> Knowledge and Media Technologies
>> Salzburg Research Forschungsgesellschaft mbH
>> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
>> T: +43 662 2288 318 | M: +43 660 2747 925
>> sergio.fernandez@salzburgresearch.at
>> http://www.salzburgresearch.at
>>
>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Andrea Di Menna <ni...@gmail.com>.
I am sorry to bug you again :(
Yesterday I was trying Marmotta but had the following problems which I am
not able to resolve yet:
- deployed the marmotta war (downloaded from the website) on a Tomcat 6
installation:  the webui was showing up but some functionalities were not
available due to missing jQuery and other JavaScript libraries
- after that I cloned the git repo and compiled marmotta following
instructions on the website. Run the war using Tomcat 7 maven plugin but
marmotta webui was not showing up (jquery and stuff were available though)

As far as I understood the problems with Tomcat 6 were due to
incompatibilities between webjars packaging and servlet < 3.0
Problems with Tomcat 7 should be due to incompatibilities between packaging
of marmotta-core webapp and the way the war is built (all the jar
dependencies are added to WEB-INF/lib but marmotta-core has resources
outside of the resources dir).

What I am doing wrong?
Thanks a lot.
Andrea
Il 22/nov/2013 16:54 "Sergio Fernández" <
sergio.fernandez@salzburgresearch.at> ha scritto:

> Hi,
>
> On 22/11/13 16:52, Andrea Di Menna wrote:
>
>> The problem was that JAVA_HOME was not set and it was commented out in
>> /etc/default/tomcat6
>> Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.
>>
>> I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and everything
>> is
>> working fine.
>>
>
> I knew should be something like that... great! issue solved
>
> --
> Sergio Fernández
> Senior Researcher
> Knowledge and Media Technologies
> Salzburg Research Forschungsgesellschaft mbH
> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
> T: +43 662 2288 318 | M: +43 660 2747 925
> sergio.fernandez@salzburgresearch.at
> http://www.salzburgresearch.at
>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Sergio Fernández <se...@salzburgresearch.at>.
Hi,

On 22/11/13 16:52, Andrea Di Menna wrote:
> The problem was that JAVA_HOME was not set and it was commented out in
> /etc/default/tomcat6
> Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.
>
> I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and everything is
> working fine.

I knew should be something like that... great! issue solved

-- 
Sergio Fernández
Senior Researcher
Knowledge and Media Technologies
Salzburg Research Forschungsgesellschaft mbH
Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
T: +43 662 2288 318 | M: +43 660 2747 925
sergio.fernandez@salzburgresearch.at
http://www.salzburgresearch.at

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Andrea Di Menna <ni...@gmail.com>.
Hi Sergio,

thanks for your answer.
Yes I am using JDK 7.0

$ sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority
Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062
 auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061
 manual mode
* 2           /usr/lib/jvm/java-7-oracle/jre/bin/java                1062
   manual mode

The problem was that JAVA_HOME was not set and it was commented out in
/etc/default/tomcat6
Tomcat was auto-selecting /usr/lib/jvm/java-6-openjdk-amd64.

I have now uncommented JAVA_HOME in  /etc/default/tomcat6 and everything is
working fine.

Thanks :)

Andrea


2013/11/22 Sergio Fernández <se...@salzburgresearch.at>

> Hi Andrea,
>
>
> On 22/11/13 16:26, Andrea Di Menna wrote:
>
>> I just downloaded apache-marmotta-3.1.0-incubating-webapp.zip from the
>> website and deployed it on a Tomcat 6.0 instance.
>>
>> I am getting the following error:
>>
>> SEVERE: Error deploying web application archive marmotta.war
>> java.lang.UnsupportedClassVersionError:
>> org/apache/marmotta/platform/core/jndi/MarmottaJndiListener : Unsupported
>> major.minor version 51.0 (unable to load class
>> org.apache.marmotta.platform.core.jndi.MarmottaJndiListener)
>>
>
> are you sure Tomcat is executed with a JRE 7?
>
> Because that error means that the class MarmottaJndiListener was compiled
> with the version 7 of the compiler (major.minor version 51.0), which is not
> supported by your current runtime.
>
> So, please, check it. No sure what OS you are using, but in GNU/Linux you
> can do it by executing:
>
>   sudo update-alternatives --config java
>
> Hope this helps.
>
> Cheers,
>
> --
> Sergio Fernández
> Senior Researcher
> Knowledge and Media Technologies
> Salzburg Research Forschungsgesellschaft mbH
> Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
> T: +43 662 2288 318 | M: +43 660 2747 925
> sergio.fernandez@salzburgresearch.at
> http://www.salzburgresearch.at
>

Re: Cannot run Marmotta war with Java 7 (51.0)

Posted by Sergio Fernández <se...@salzburgresearch.at>.
Hi Andrea,

On 22/11/13 16:26, Andrea Di Menna wrote:
> I just downloaded apache-marmotta-3.1.0-incubating-webapp.zip from the
> website and deployed it on a Tomcat 6.0 instance.
>
> I am getting the following error:
>
> SEVERE: Error deploying web application archive marmotta.war
> java.lang.UnsupportedClassVersionError:
> org/apache/marmotta/platform/core/jndi/MarmottaJndiListener : Unsupported
> major.minor version 51.0 (unable to load class
> org.apache.marmotta.platform.core.jndi.MarmottaJndiListener)

are you sure Tomcat is executed with a JRE 7?

Because that error means that the class MarmottaJndiListener was 
compiled with the version 7 of the compiler (major.minor version 51.0), 
which is not supported by your current runtime.

So, please, check it. No sure what OS you are using, but in GNU/Linux 
you can do it by executing:

   sudo update-alternatives --config java

Hope this helps.

Cheers,

-- 
Sergio Fernández
Senior Researcher
Knowledge and Media Technologies
Salzburg Research Forschungsgesellschaft mbH
Jakob-Haringer-Straße 5/3 | 5020 Salzburg, Austria
T: +43 662 2288 318 | M: +43 660 2747 925
sergio.fernandez@salzburgresearch.at
http://www.salzburgresearch.at