Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Multiple spring deployments on Virgo 3.7.M03?
Multiple spring deployments on Virgo 3.7.M03? [message #1751445] Tue, 10 January 2017 13:06 Go to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 26
Registered: June 2012
Junior Member
Hi,

I'm trying to start migrating to Eclipse Virgo 3.7.M03 to move to Spring 4.2.x.
I'm getting a stream of Uses violation errors that we didn't have before with 3.6.4. I had to make some adjustments to migrate the spring schemas and remove the springframework libd which seems to be gone now but nothing to explain the following:

[2017-01-10 12:11:55.626] ERROR  TCP Connection(2)-127.0.0.1 org.eclipse.virgo.medic.eventlog.default                         DE0002E Installation of bundle 'org.geppetto.frontend' version '0.3.3' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'org.geppetto.frontend' at version '0.3.3': Cannot resolve: org.geppetto.frontend
    Resolver report:
        Uses violation: <Import-Package: org.springframework.web.servlet.resource; version="0.0.0"> in bundle <org.geppetto.frontend_0.3.3[1484050304691]>
             Resolver reported uses conflict for import constrained to bundle <org.springframework.webmvc> constrained bundle version range "[4.2.4.v20160512-1057,4.2.4.v20160512-1057]"
        Uses violation: <Import-Package: org.springframework.context.event; version="0.0.0"> in bundle <org.geppetto.frontend_0.3.3[1484050304691]>
            Found conflicts:
                package        'org.springframework.core.annotation_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[60]' used by 'org.springframework.context.event_4.2.4' in bundle 'org.springframework.context_4.2.4.v20160512-1057[59]'
                conflicts with 'org.springframework.core.annotation_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[91]' used by 'org.springframework.web.servlet.resource_4.2.4' in bundle 'org.springframework.webmvc_4.2.4.v20160512-1057[1484050304692]'
                package        'org.springframework.core.annotation_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[60]' used by 'org.springframework.context.event_4.2.4' in bundle 'org.springframework.context_4.2.4.v20160512-1057[59]'
                conflicts with 'org.springframework.core.annotation_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[91]' used by 'org.springframework.web.servlet.config.annotation_4.2.4' in bundle 'org.springframework.webmvc_4.2.4.v20160512-1057[1484050304692]'
                package        'org.springframework.util_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[60]' used by 'org.springframework.context.event_4.2.4' in bundle 'org.springframework.context_4.2.4.v20160512-1057[59]'
                conflicts with 'org.springframework.util_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[91]' used by 'org.springframework.web.servlet.resource_4.2.4' in bundle 'org.springframework.webmvc_4.2.4.v20160512-1057[1484050304692]'
                package        'org.springframework.util_4.2.4' in bundle 'org.springframework.core_4.2.4.v20160512-1057[60]' used by 'org.springframework.context.event_4.2.4' in bundle 'org.springframework.context_4.2.4.v20160512-1057[59]'


I then decided to check the Eclipse console of a freshly download Virgo 3.7.M03 without any application deployed and after starting it I've noticed something that seems weird to me, all springframeworks artifcats are deployed twice, see screenshot attached.

Am I missing something? Is there a problem with M03?

Thanks!
Matteo

[Updated on: Tue, 10 January 2017 13:06]

Report message to a moderator

Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751450 is a reply to message #1751445] Tue, 10 January 2017 13:45 Go to previous messageGo to next message
daniel marthaler is currently offline daniel marthalerFriend
Messages: 77
Registered: April 2012
Location: Zürich
Member
Matteo Cantarelli wrote on Tue, 10 January 2017 14:06


I'm trying to start migrating to Eclipse Virgo 3.7.M03 to move to Spring 4.2.x.
I'm getting a stream of Uses violation errors that we didn't have before with 3.6.4. I had to make some adjustments to migrate the spring schemas and remove the springframework libd which seems to be gone now but nothing to explain the following:


Did you add additional dependencies by your own?

Matteo Cantarelli wrote on Tue, 10 January 2017 14:06

I then decided to check the Eclipse console of a freshly download Virgo 3.7.M03 without any application deployed and after starting it I've noticed something that seems weird to me, all springframeworks artifcats are deployed twice, see screenshot attached.

Am I missing something? Is there a problem with M03?


The reason that you can see two artifacts of deployed of each Spring bundle comes from the fact that there is a kernel and user region. If you expand the nodes of this tree you should be able to see which is deployed to kernel and which to user region.

[Updated on: Tue, 10 January 2017 13:48]

Report message to a moderator

Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751454 is a reply to message #1751450] Tue, 10 January 2017 13:59 Go to previous messageGo to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 26
Registered: June 2012
Junior Member
Alright, thanks.
Nothing we didn't have before, In the pom we have (with <spring.version>4.2.4.RELEASE</spring.version>):

<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.version}</version>
		</dependency>


In the generated MANIFEST

Manifest-Version: 1.0
Bnd-LastModified: 1484049660511
Build-Jdk: 1.7.0_51
Built-By: matteocantarelli
Bundle-ClassPath: .,WEB-INF/classes
Bundle-ManifestVersion: 2
Bundle-Name: Geppetto Frontend
Bundle-SymbolicName: org.geppetto.frontend
Bundle-Version: 0.3.3
Created-By: Apache Maven Bundle Plugin
Export-Package: org.geppetto.frontend;uses:="org.springframework.context
 ,org.springframework.context.event";version="0.3.3",org.geppetto.fronte
 nd.controllers;uses:="org.geppetto.core.data,org.geppetto.core.data.mod
 el,org.apache.commons.logging,org.apache.shiro,org.springframework.bean
 s.factory.annotation,org.apache.shiro.subject,org.geppetto.core.utiliti
 es,org.springframework.web.bind.annotation,org.geppetto.core.manager,or
 g.geppetto.core.common,org.geppetto.core.auth,org.springframework.stere
 otype,com.google.gson,org.geppetto.frontend.tests,javax.servlet.http,or
 g.osgi.framework,org.geppetto.model.util,org.geppetto.model.datasources
 ,org.geppetto.core.datasources,org.eclipse.emf.ecore,org.geppetto.core.
 services.registry,org.geppetto.frontend,org.geppetto.simulation.manager
 ,org.geppetto.core.beans,org.geppetto.frontend.messages,com.fasterxml.j
 ackson.databind,com.fasterxml.jackson.core.type,org.geppetto.core.simul
 ation,org.geppetto.core.model,com.fasterxml.jackson.core,org.geppetto.m
 odel,org.apache.catalina.websocket,org.apache.shiro.authc,org.apache.sh
 iro.realm,javax.servlet,org.springframework.http.converter,org.springfr
 amework.util,org.springframework.http,com.google.gson.reflect,org.eclip
 se.emf.common.util,org.springframework.context,org.geppetto.frontend.me
 ssaging,org.springframework.web.context.support";version="0.3.3",org.ge
 ppetto.frontend.dashboard.service;uses:="org.geppetto.core.data,org.gep
 petto.core.data.model,org.springframework.beans.factory.annotation,org.
 springframework.core.io,org.geppetto.core.utilities,org.springframework
 .web.bind.annotation,org.geppetto.core.manager,org.geppetto.core.common
 ,org.geppetto.core.beans,org.springframework.stereotype,org.geppetto.si
 mulation.visitor,org.geppetto.model.util,org.geppetto.core.model,org.ec
 lipse.emf.ecore.util,org.eclipse.emf.ecore,org.geppetto.model,org.apach
 e.commons.logging,org.apache.shiro,org.apache.shiro.subject";version="0
 .3.3",org.geppetto.frontend.messages;uses:="org.geppetto.frontend,com.g
 oogle.gson";version="0.3.3",org.geppetto.frontend.messaging;uses:="org.
 apache.commons.logging,org.geppetto.frontend.messages,org.apache.catali
 na.websocket,com.google.gson";version="0.3.3",org.geppetto.frontend.tes
 ts;uses:="com.google.gson.annotations";version="0.3.3"
Import-Bundle: org.springframework.aop;version="4.2.4.RELEASE",org.sprin
 gframework.webmvc;version="4.2.4.RELEASE",org.apache.commons.logging
Import-Package: com.fasterxml.jackson.core;version="[2.8,3)",com.fasterx
 ml.jackson.core.type;version="[2.8,3)",com.fasterxml.jackson.databind;v
 ersion="[2.8,3)",com.google.gson;version="[2.2,3)",com.google.gson.anno
 tations;version="[2.2,3)",com.google.gson.reflect;version="[2.2,3)",jav
 ax.servlet,javax.servlet.http,org.apache.catalina.websocket,org.apache.
 commons.logging;version="[1.1,2)",org.apache.shiro;version="[1.2,2)",or
 g.apache.shiro.authc;version="[1.2,2)",org.apache.shiro.realm;version="
 [1.2,2)",org.apache.shiro.subject;version="[1.2,2)",org.apache.shiro.we
 b.env;version="[1.2,2)",org.apache.shiro.web.servlet;version="[1.2,2)",
 org.eclipse.emf.common.util,org.eclipse.emf.ecore,org.eclipse.emf.ecore
 .util,org.eclipse.virgo.web.dm,org.geppetto.core.auth;version="[0.3,1)"
 ,org.geppetto.core.beans;version="[0.3,1)",org.geppetto.core.common;ver
 sion="[0.3,1)",org.geppetto.core.data;version="[0.3,1)",org.geppetto.co
 re.data.model;version="[0.3,1)",org.geppetto.core.datasources;version="
 [0.3,1)",org.geppetto.core.manager;version="[0.3,1)",org.geppetto.core.
 model;version="[0.3,1)",org.geppetto.core.s3;version="[0.3,1)",org.gepp
 etto.core.services.registry;version="[0.3,1)",org.geppetto.core.simulat
 ion;version="[0.3,1)",org.geppetto.core.utilities;version="[0.3,1)",org
 .geppetto.model;version="[0.3,1)",org.geppetto.model.datasources;versio
 n="[0.3,1)",org.geppetto.model.util;version="[0.3,1)",org.geppetto.simu
 lation;version="[0.3,1)",org.geppetto.simulation.manager;version="[0.3,
 1)",org.geppetto.simulation.visitor;version="[0.3,1)",org.osgi.framewor
 k;version="[1.7,2)",org.springframework.beans.factory.annotation,org.sp
 ringframework.cglib.beans,org.springframework.cglib.core,org.springfram
 ework.cglib.proxy,org.springframework.cglib.reflect,org.springframework
 .cglib.transform,org.springframework.cglib.util,org.springframework.con
 text,org.springframework.context.event,org.springframework.core.io,org.
 springframework.http,org.springframework.http.converter,org.springframe
 work.stereotype,org.springframework.util,org.springframework.web.bind.a
 nnotation,org.springframework.web.context,org.springframework.web.conte
 xt.request,org.springframework.web.context.support
Tool: Bnd-1.50.0
Web-ContextPath: org.geppetto.frontend
Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751489 is a reply to message #1751454] Tue, 10 January 2017 17:31 Go to previous messageGo to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 26
Registered: June 2012
Junior Member
Looks like what triggers the uses violation is org.apache.commons.logging which seems to be exposed from the kernel region but also brought in by application bundles.
If I remove this dependency I have another error:

Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityConfig' defined in ServletContext resource [/WEB-INF/spring/app-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.view.velocity.VelocityConfigurer]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory


so it looks like the exported commons.loggins from the kernel region which is used by springframework is not somehow visible when org.springframework.web.servlet.view.velocity.VelocityConfigurer tries to use it? Ideas? Thanks!
Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751497 is a reply to message #1751489] Tue, 10 January 2017 19:24 Go to previous messageGo to next message
daniel marthaler is currently offline daniel marthalerFriend
Messages: 77
Registered: April 2012
Location: Zürich
Member
Hi

I just checked the packageImports in org.eclipse.virgo.kernel.userregion.properties and identified the export org.apache.commons.logging:

packageImports =\
 org.eclipse.virgo.kernel.artifact.*;version="0",\
 org.eclipse.virgo.nano.core;version="0",\
 org.eclipse.virgo.nano.deployer.api.*;version="0",\
 org.eclipse.virgo.nano.deployer.api;version="0",\
 org.eclipse.virgo.nano.deployer;version="0",\
 org.eclipse.virgo.kernel.deployer.core.event;version="0",\
 org.eclipse.virgo.kernel.install.*;version="0",\
 org.eclipse.virgo.kernel.osgi.*;version="0",\
 org.eclipse.virgo.kernel.model;version="0",\
 org.eclipse.virgo.kernel.model.management;version="0",\
 org.eclipse.virgo.kernel.module;version="0",\
 org.eclipse.virgo.kernel.equinox.extensions.hooks;version="0",\
 org.eclipse.virgo.nano.serviceability;version="0",\
 org.eclipse.virgo.nano.serviceability.*;version="0",\
 org.eclipse.virgo.kernel.services.work;version="0",\
 org.eclipse.virgo.nano.shim.*;version="0",\
 org.eclipse.virgo.medic.*;version="0",\
 org.eclipse.virgo.repository;version="0",\
 org.eclipse.virgo.repository.*;version="0",\
 org.eclipse.virgo.util.*;version="0",\
 org.apache.commons.logging;version="[1.0.0,2.0.0)",\
 org.apache.commons.logging.impl;version="[1.0.0,2.0.0)",\
 org.aspectj.*;version="[1.6.5.RELEASE,2.0.0)",\
 org.osgi.service.event;version="0",\
 org.osgi.service.log;version="0",\
 org.osgi.service.http;version="0",\
 javax.servlet;version="2.6.0",\
 javax.servlet.*;version="2.6.0",\
 org.eclipse.equinox.region;version="1",\
 ch.qos.logback.*;version="[1.0.0,2.0.0)",\
 org.slf4j;version="[1.6.4,2)",\
 org.slf4j.helpers;version="[1.6.4,2)",\
 org.slf4j.spi;version="[1.6.4,2)",\
 org.springframework.util;version="[4.2.1,5)"


Also when I start Virgo Tomcat Server 3.7.0.M03, go to the Web Admin Console I can see that org.apache.commons.logging: 1.2.0.v20151023-1447 bundle is active and used by org.eclipse.gemini.blueprint.core: 2.0.0.RELEASE bundle:
index.php/fa/28079/0/
Can you please check on your side if you can see the same?

Regards,
Dani
Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751498 is a reply to message #1751497] Tue, 10 January 2017 19:31 Go to previous messageGo to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 26
Registered: June 2012
Junior Member
I do, see attached screenshot.

https://www.eclipse.org/forums/index.php?t=getfile&id=28080&

I usually solve this type of problems adding an import package on the manifest but in this case org.apache.commons.logging is already there.
Spent all day looking at this, thanks for the help, much appreciated!

[Updated on: Tue, 10 January 2017 19:33]

Report message to a moderator

Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751503 is a reply to message #1751498] Tue, 10 January 2017 20:42 Go to previous messageGo to next message
Matteo Cantarelli is currently offline Matteo CantarelliFriend
Messages: 26
Registered: June 2012
Junior Member
To recap:

Without the following in app-config.xml

	<bean id="velocityConfig"
		class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
		<property name="resourceLoaderPath">
			<value>/</value>
		</property>
	</bean>


and without org.apache.commons.logging among the <Import-Bundle> the bundle starts correctly.
With the bean and without org.apache.commons.logging among the <Import-Bundle> the bundle doesn't start throwing java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory.
With the bean and with org.apache.commons.logging among the <Import-Bundle> it throws Uses conflict.

Any help is appreciated, thanks.
Re: Multiple spring deployments on Virgo 3.7.M03? [message #1751658 is a reply to message #1751503] Thu, 12 January 2017 10:31 Go to previous message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 49
Registered: November 2015
Member
Could you try to replace import-bundle with package imports making sure to specify the package version for every imported package?
Previous Topic:Discontinuation of VNF and VJS distributions beginning with the 3.7.0.M04 release
Next Topic:Virgo 3.7.0.M03 - Class loader management
Goto Forum:
  


Current Time: Mon Sep 24 01:32:13 GMT 2018

Powered by FUDForum. Page generated in 0.02250 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top