VMware Cloud Community
pengchen4
Contributor
Contributor

Maven Plugin Package o11n-package: ImportPackageMojo.importSinglePackage() throw an error said java.lang.NoClassDefFoundError: org/slf4j/event/LoggingEvent

I'm trying to sync a package from a vRO which version is 7.0.1 var the plugin package maven-o11n-package-plugin. and I got an error which locates on ImportPackageMojo.importSinglePackage().any idea on this?

org.apache.maven.plugin.MojoExecutionException: Unable to import package [package.used.for.sync], from server '[**************************************]'

  at com.vmware.o11n.mojo.pkg.ImportPackageMojo.importSinglePackage(ImportPackageMojo.java:194)

  at com.vmware.o11n.mojo.pkg.ImportPackageMojo.execute(ImportPackageMojo.java:144)

  at com.emc.ehc.service.impl.RepositoryServiceImpl.syncUpPackage(RepositoryServiceImpl.java:100)

  at com.ehc.emc.review.tool.PackageTool.syncPackage(PackageTool.java:38)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

  at java.lang.reflect.Method.invoke(Unknown Source)

  at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)

  at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$VoidOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:167)

  at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)

  at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)

  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

  at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)

  at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

  at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)

  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)

  at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)

  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)

  at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)

  at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)

  at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)

  at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)

  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)

  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)

  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)

  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)

  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)

  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

  at java.lang.Thread.run(Unknown Source)

Caused by: org.springframework.remoting.RemoteAccessException: Could not deserialize result from HTTP invoker remote service [https://10.103.201.81:8281/vco/webremoting/vcofactory.service]; nested exception is java.lang.NoClassDefFoundError: org/slf4j/event/LoggingEvent

  at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:212)

  at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:147)

  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)

  at com.sun.proxy.$Proxy54.invokeOperation(Unknown Source)

  at com.vmware.o11n.model.support.proxy.RemoteHttpVSOFactoryInvocationHandler.doInvoke(RemoteHttpVSOFactoryInvocationHandler.java:186)

  at com.vmware.o11n.model.support.proxy.RemoteHttpVSOFactoryInvocationHandler.invoke(RemoteHttpVSOFactoryInvocationHandler.java:138)

  at com.sun.proxy.$Proxy55.getPackageContent(Unknown Source)

  at ch.dunes.model.client.VSOFactoryClient.getPackageContent(VSOFactoryClient.java:2170)

  at ch.dunes.model.pkg.Package.loadContent(Package.java:234)

  at ch.dunes.model.pkg.impexp.LocalPackageFileManager.writePackage(LocalPackageFileManager.java:148)

  at com.vmware.o11n.mojo.pkg.ImportPackageMojo.importSinglePackage(ImportPackageMojo.java:189)

  ... 44 more

Caused by: java.lang.NoClassDefFoundError: org/slf4j/event/LoggingEvent

  at java.lang.Class.getDeclaredMethods0(Native Method)

  at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

  at java.lang.Class.getDeclaredMethod(Unknown Source)

  at java.io.ObjectStreamClass.getPrivateMethod(Unknown Source)

  at java.io.ObjectStreamClass.access$1700(Unknown Source)

  at java.io.ObjectStreamClass$2.run(Unknown Source)

  at java.io.ObjectStreamClass$2.run(Unknown Source)

  at java.security.AccessController.doPrivileged(Native Method)

  at java.io.ObjectStreamClass.<init>(Unknown Source)

  at java.io.ObjectStreamClass.lookup(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

  at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

  at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.writeArray(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

  at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

  at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.writeArray(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

  at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

  at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

  at java.io.ObjectOutputStream.writeObject0(Unknown Source)

  at java.io.ObjectOutputStream.writeObject(Unknown Source)

  at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.doWriteRemoteInvocation(AbstractHttpInvokerRequestExecutor.java:200)

  at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.writeRemoteInvocation(AbstractHttpInvokerRequestExecutor.java:169)

  at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.getByteArrayOutputStream(AbstractHttpInvokerRequestExecutor.java:149)

  at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:133)

  at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:194)

  at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:176)

  at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)

  ... 54 more

Caused by: java.lang.ClassNotFoundException: org.slf4j.event.LoggingEvent

  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332)

  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)

  ... 89 more

Tags (1)
0 Kudos
4 Replies
iiliev
VMware Employee
VMware Employee

Hmm, org/slf4j/event/LoggingEvent is marked as available since SLF4J version 1.7.15, and vRO 7.0.1/vRO 7.1.0 are using an older version 1.7.13.

Could you check the exact version/build number of vRO server(s) you are using? Also, please provide the command line you are executing to sync the package.

0 Kudos
pengchen4
Contributor
Contributor

thanks a lot for your appreciated replying, I found my vRO version is 6.0.3, and the SLF4J version is 1.6.6. so that could explain why I met the issue base on your comment.

slf4j.png

In order to solve the issue,I did below four things to use new version of SLF4J to replace old one

1. decompression vco.war under /usr/lib/vco/app-server/deploy/

2. copy slf4j-api-1.7.21.jar into /WEB-INF/lib and remove the older one

3. rejaring a new vco.war

4. restart vco-erver

but the issue still be there when I sync package. BTW, I didn't use any command line to sync package. what I'm doing is sync a package through calling a web service, and in this web service I invoke the method ImportPackageMojo.execute() to do syncronization

may I missed something during deploying new war file, do you know how to deploy a new vco.war which includes JSLF4J-api-1.7.2.jar into vco-server?

0 Kudos
iiliev
VMware Employee
VMware Employee

OK, the steps to update some library in vRO would be something like the following:

  • Stop vRO server service - service vco-server stop
  • Update the library files inside vco.war - you figured out how to do so already. Just one note - for SLF4J I'd recommend to update not only slf4j-api-[version].jar but also slf4j-log4j12-[version].jar
  • Delete the cached Tomcat content
    • Remove the folders vco and ROOT from folder /usr/lib/vco/app-server/deploy/, leaving only the files vco.war (containing updated library) and ROOT.war. The directories will be recreated automatically by expanding the content of the war files during vRO server startup.
    • Remove the files/subfolders in folders /var/lib/vco/app-server/temp/ and /var/lib/vco/app-server/work/ (the folders themselves should not be deleted; Tomcat uses them)
  • Start vRO server service - service vco-server start

And a few general notes:

  • ImportPackageMojo class is a Maven Mojo that is designed to be used only by maven-o11n-package-plugin Maven plug-in. The class is not part of public Java SDK so we don't support it outside the context of maven-o11n-package-plugin. Out of curiosity, do you have an option not to link to and invoke ImportPackageMojo class directly, but instead run the package synchronization as an external command/process?
  • It seems SLF4J version 1.7.21 is coming as a dependency from your Web service. If you are building this service yourself, you can try to downgrade SLF4J library used by the Web service to the same version used by vRO (just to validate that it will work if the library version matches).
0 Kudos
pengchen4
Contributor
Contributor

You're right, ImportPackageMojo class is a Maven Mojo that is designed to be used only by maven-o11n-package-plugin Maven plug-in, So I refer it maven-o11n-package-plugin.jar a dependency in my maven project. and I created a web service which invoke function of this class to sync package in my local file system. that works in my Unit Test, but failed by sending rest call due to the error we discussed.

Redeployed vco.war follow your suggest! same issue still be there. unfortunately, I'll try to used vro 7.0.1 to see if I can do it.

0 Kudos