Project

General

Profile

Actions

Support #10194

closed

Error calling JCRHomeManager.getHome

Added by Salvatore Minutoli over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Application
Start date:
Nov 02, 2017
Due date:
% Done:

100%

Estimated time:
Infrastructure:
Development

Description

I am running a plugin TwCrawler as part of the TwitterMonitor application.
The plugin is running on node19.d4science.org VM in devNext/NextNext scope.
When I call the JCRHomeManager.getHome function I get an Exception (see catalina.out):
Nov 02, 2017 4:07:07 PM com.sun.xml.ws.server.sei.EndpointMethodHandler invoke
SEVERE: org/gcube/common/homelibrary/home/workspace/WorkspaceInternalLink
java.lang.NoClassDefFoundError: org/gcube/common/homelibrary/home/workspace/WorkspaceInternalLink
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2966)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1209)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1689)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1570)
at org.gcube.common.homelibrary.jcr.home.JCRHome.(JCRHome.java:39)
at org.gcube.common.homelibrary.jcr.JCRHomeManager.getHome(JCRHomeManager.java:116)
at it.cnr.iit.wafi.gcube.twmon.crawler.TwCrawler.createResFolder(TwCrawler.java:357)
at it.cnr.iit.wafi.gcube.twmon.crawler.TwCrawler.transferFiles(TwCrawler.java:290)
at it.cnr.iit.wafi.gcube.twmon.crawler.TwCrawler.onStop(TwCrawler.java:451)
at org.gcube.vremanagement.executor.plugin.Plugin.stop(Plugin.java:100)
at org.gcube.vremanagement.executor.pluginmanager.RunnablePlugin.stop(RunnablePlugin.java:254)
at org.gcube.vremanagement.executor.scheduler.SmartExecutorTask.interrupt(SmartExecutorTask.java:276)
at org.quartz.core.QuartzScheduler.interrupt(QuartzScheduler.java:2347)
at org.quartz.impl.StdScheduler.interrupt(StdScheduler.java:600)
at org.gcube.vremanagement.executor.scheduler.SmartExecutorScheduler.stopTask(SmartExecutorScheduler.java:227)
at org.gcube.vremanagement.executor.scheduler.SmartExecutorScheduler.stop(SmartExecutorScheduler.java:277)
at org.gcube.vremanagement.executor.SmartExecutorImpl.reallyUnSchedule(SmartExecutorImpl.java:92)
at org.gcube.vremanagement.executor.SmartExecutorImpl.unSchedule(SmartExecutorImpl.java:81)
at org.gcube.vremanagement.executor.SmartExecutorImpl.stop(SmartExecutorImpl.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.gcube.smartgears.managers.RequestManager.doFilter(RequestManager.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.gcube.common.homelibrary.home.workspace.WorkspaceInternalLink
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1719)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1570)
... 63 more

In the pom.xml I am using :

org.gcube.common
home-library-jcr
[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)


org.gcube.common
home-library
[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)

    HomeManagerFactory factory;
    HomeManager manager;
    try
    {
        logger.debug("createResFolder");
        factory =     HomeLibrary.getHomeManagerFactory();
        manager = factory.getHomeManager();
        User user = manager.createUser(userName);
        Home home = manager.getHome(user);

I did not have this error on previous tests on node19 in devNext/NextNext.
Could it be some library version mismatch?

Actions #1

Updated by Andrea Dell'Amico over 7 years ago

  • Assignee changed from _InfraScience Systems Engineer to Luca Frosini
Actions #2

Updated by Luca Frosini over 7 years ago

@salvatore.minutoli@iit.cnr.it can you verify the the scope of the dependencies. I suppose that is provided and is not included in the jar-with-dependecies

Actions #3

Updated by Luca Frosini over 7 years ago

  • Status changed from New to Feedback
Actions #4

Updated by Salvatore Minutoli over 7 years ago

  • Assignee changed from Luca Frosini to _InfraScience Systems Engineer

The scope for the Home library dependecies is not specified.
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>

In the jar file TwMonCrawlerPlugin-0.0.1-SNAPSHOT-jar-with-dependencies.jar (http://data.d4science.org/dW5HSG92U3NEYnBXNWJBdXQ0YnRKc25nem9PMUE0aGRHbWJQNStIS0N6Yz0) there are a lot of classes for the org/gcube/common/homelibrary/home/workspace/ package (i.e. WorkspaceItem, WorkspaceFolder, ...) but the class specified in the Exception is not present.

Actions #5

Updated by Luca Frosini over 7 years ago

  • Assignee changed from _InfraScience Systems Engineer to Lucio Lelii
Actions #6

Updated by Costantino Perciante over 7 years ago

Hi Salvatore,

I don't know why you are facing that error. However, the right code to get your home is this one:

     // set context and own token
    ScopeProvider.instance.set(context);
    SecurityTokenProvider.instance.set(authorizationToken);

    // get home
    Home ws = HomeLibrary
        .getHomeManagerFactory()
        .getHomeManager()
            .getHome();

Hope it helps

Actions #7

Updated by Costantino Perciante over 7 years ago

Ah, I just recognized the error: you should force the update of the home library dependencies (the WorkspaceInternalLink interface is no longer available in the home-library interface)

Actions #8

Updated by Salvatore Minutoli over 7 years ago

  • Assignee changed from Lucio Lelii to _InfraScience Systems Engineer

Is it ok if I change the pom.xml in the following way?

<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.11.1-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.10.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>

Actions #9

Updated by Andrea Dell'Amico over 7 years ago

  • Assignee changed from _InfraScience Systems Engineer to Lucio Lelii

It's a question for @lucio.lelii@isti.cnr.it too :)

Actions #10

Updated by Luca Frosini over 7 years ago

@salvatore.minutoli@iit.cnr.it you can do it but you don't need to do it. You (should) just need to force dependencies update (i.e. mvn -U clean install). Anyway if you changed the version as you described it should be fine. @costantino.perciante@isti.cnr.it is the lower bound the right one?

Actions #11

Updated by Luca Frosini over 7 years ago

  • Status changed from Feedback to In Progress
  • Assignee changed from Lucio Lelii to Luca Frosini
Actions #12

Updated by Luca Frosini over 7 years ago

  • Status changed from In Progress to Feedback
  • Assignee changed from Luca Frosini to Salvatore Minutoli

@salvatore.minutoli@iit.cnr.it I noticed that yesterday you updated one of the smart-executor plugin. If the issue is solved please close the ticket.

Actions #13

Updated by Salvatore Minutoli over 7 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)