Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Upgrading version of spring
Upgrading version of spring [message #649372] Tue, 18 January 2011 23:57 Go to next message
gkontos  is currently offline gkontos Friend
Messages: 10
Registered: January 2011
Junior Member
First, I'd like to thank the folks who post to this forum for all the help I've received from reading their blogs and posts on this site. It took me a little while, but I was able to move my site from spring 2.x running on tomcat 5.5 format to spring 3.x running on a virgo web server. You guys have been a huge help.

But, I have a question:
Is it possible to upgrade the version of spring within the virgo repository/ext? I would like to update the versions of the spring jars so that I can use spring security 3.0.5 which requires spring 3.0.3 or higher jars.

The first thing I tried was to add the new spring 3.0.3 jars into the repository/usr directory, but this caused an error saying that there was a version conflict between the spring jars (or something along those lines). The next thing I tried was to remove the old spring jars from repository/ext, replace them with the newer jars and restart the server using the -clean option. After completing this, the server would not start at all.

Is there a path to upgrade the spring jars or do I need to wait for Virgo to upgrade before an upgrade is possible?
Re: Upgrading version of spring [message #649387 is a reply to message #649372] Wed, 19 January 2011 03:02 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Make sure you replace the corresponding .lib file in repository/ext as well as replacing all the Spring framework bundles referenced by the .lib file. It should be possible to upgrade to Spring 3.0.5, for example.

If this still doesn't work, please can you paste the failure diagnostics here.

Please note that we expect to upgrade Spring as part of the next release of Virgo - see bug 314282.
Re: Upgrading version of spring [message #649501 is a reply to message #649387] Wed, 19 January 2011 13:42 Go to previous messageGo to next message
gkontos  is currently offline gkontos Friend
Messages: 10
Registered: January 2011
Junior Member
Thanks Glyn -- I'll give that a try as soon as I get a chance and let you know what happens.
Re: Upgrading version of spring [message #650111 is a reply to message #649501] Fri, 21 January 2011 19:33 Go to previous messageGo to next message
gkontos  is currently offline gkontos Friend
Messages: 10
Registered: January 2011
Junior Member
Hi Glyn, it didn't work again... perhaps I am doing something else wrong. Either way, I will probably go ahead and stick with what works until the next release.

FYI, I've attached the log file. Also included is my manifest file.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: whale_probe
Bundle-SymbolicName: whale_probe
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: whale_probe.jar,
WebRoot/WEB-INF/lib/FastInfoset.jar,
WebRoot/WEB-INF/lib/activation.jar,
WebRoot/WEB-INF/lib/aopalliance-1.0.jar,
WebRoot/WEB-INF/lib/aspectjrt-1.5.4.jar,
WebRoot/WEB-INF/lib/backport-util-concurrent.jar,
WebRoot/WEB-INF/lib/bcmail-jdk14-128.jar,
WebRoot/WEB-INF/lib/bcprov-ext-jdk15-141.jar,
WebRoot/WEB-INF/lib/bcprov-jdk15-141.jar,
WebRoot/WEB-INF/lib/cglib-nodep-2.1_3.jar,
WebRoot/WEB-INF/lib/commons-beanutils.jar,
WebRoot/WEB-INF/lib/commons-codec.jar,
WebRoot/WEB-INF/lib/commons-collections.jar,
WebRoot/WEB-INF/lib/commons-dbcp.jar,
WebRoot/WEB-INF/lib/commons-digester.jar,
WebRoot/WEB-INF/lib/commons-fileupload.jar,
WebRoot/WEB-INF/lib/commons-httpclient.jar,
WebRoot/WEB-INF/lib/commons-logging.jar,
WebRoot/WEB-INF/lib/commons-pool.jar,
WebRoot/WEB-INF/lib/el-api.jar,
WebRoot/WEB-INF/lib/el-ri.jar,
WebRoot/WEB-INF/lib/icefaces-comps.jar,
WebRoot/WEB-INF/lib/icefaces-facelets.jar,
WebRoot/WEB-INF/lib/icefaces.jar,
WebRoot/WEB-INF/lib/json_simple.jar,
WebRoot/WEB-INF/lib/jta.jar,
WebRoot/WEB-INF/lib/krysalis-jCharts-1.0.0-alpha-1.jar,
WebRoot/WEB-INF/lib/log4j-1.2.14.jar,
WebRoot/WEB-INF/lib/mail.jar,
WebRoot/WEB-INF/lib/mysql-connector-java-5.0.7-bin.jar,
WebRoot/WEB-INF/lib/objenesis-1.0.jar,
WebRoot/WEB-INF/lib/quartz-all-1.6.1.jar,
WebRoot/WEB-INF/lib/standard-1.1.2.jar,
WebRoot/WEB-INF/lib/standard.jar,
WebRoot/WEB-INF/lib/xercesImpl.jar,
WebRoot/WEB-INF/lib/xml-apis.jar,
WebRoot/WEB-INF/lib/mybatis-3.0.2.jar,
WebRoot/WEB-INF/lib/spring-security-acl-3.0.3.RELEASE.jar,
WebRoot/WEB-INF/lib/spring-security-acl-3.0.5.RELEASE-source s.jar,
WebRoot/WEB-INF/lib/spring-security-acl-3.0.5.RELEASE.jar,
WebRoot/WEB-INF/lib/spring-security-aspects-3.0.5.RELEASE-so urces.jar,
WebRoot/WEB-INF/lib/spring-security-aspects-3.0.5.RELEASE.ja r,
WebRoot/WEB-INF/lib/spring-security-config-3.0.3.RELEASE.jar ,
WebRoot/WEB-INF/lib/spring-security-config-3.0.5.RELEASE-sou rces.jar,
WebRoot/WEB-INF/lib/spring-security-config-3.0.5.RELEASE.jar ,
WebRoot/WEB-INF/lib/spring-security-core-3.0.3.RELEASE.jar,
WebRoot/WEB-INF/lib/spring-security-core-3.0.5.RELEASE-sourc es.jar,
WebRoot/WEB-INF/lib/spring-security-core-3.0.5.RELEASE.jar,
WebRoot/WEB-INF/lib/spring-security-taglibs-3.0.3.RELEASE.ja r,
WebRoot/WEB-INF/lib/spring-security-taglibs-3.0.5.RELEASE-so urces.jar,
WebRoot/WEB-INF/lib/spring-security-taglibs-3.0.5.RELEASE.ja r,
WebRoot/WEB-INF/lib/spring-security-web-3.0.3.RELEASE.jar,
WebRoot/WEB-INF/lib/spring-security-web-3.0.5.RELEASE-source s.jar,
WebRoot/WEB-INF/lib/spring-security-web-3.0.5.RELEASE.jar,
WebRoot/WEB-INF/lib/jsf-api-1.2.jar,
WebRoot/WEB-INF/lib/jsf-impl-1.2.jar,
WebRoot/WEB-INF/lib/com.springsource.javax.servlet.jsp.jstl- 1.2.0.jar,
WebRoot/WEB-INF/lib/testing/easymockclassextension.jar,
WebRoot/WEB-INF/lib/testing/hamcrest-core-1.1.jar,
WebRoot/WEB-INF/lib/testing/hamcrest-library-1.1.jar,
WebRoot/WEB-INF/lib/testing/jmock-2.5.1.jar,
WebRoot/WEB-INF/lib/testing/jmock-legacy-2.5.1.jar,
WebRoot/WEB-INF/lib/testing/jmock-script-2.5.1.jar,
WebRoot/WEB-INF/lib/testing/junit-4.8.2.jar,
WebRoot/WEB-INF/lib/testing/shale-core-1.0.5.jar,
WebRoot/WEB-INF/lib/testing/shale-spring-1.0.5.jar,
WebRoot/WEB-INF/lib/testing/shale-test-1.0.5.jar,
.
Export-Package: com.icesoft.faces.application,
... there's a bunck that were loaded by eclipse when I converted the project...
... including log4j if that's relevant to the errors ..
Import-Bundle: org.springframework.web;version="[3.0.3.RELEASE,3.0.3.RELEASE] "
Import-Package: javax.servlet,
javax.servlet.http,
org.springframework.context,
org.springframework.core.io.support,
org.springframework.dao,
org.springframework.jdbc.core.support,
org.springframework.scheduling.quartz,
org.springframework.web.context,
org.springframework.web.servlet,
org.springframework.web.util
Import-Library: org.springframework.spring
  • Attachment: log.log
    (Size: 372.43KB, Downloaded 380 times)
Re: Upgrading version of spring [message #650291 is a reply to message #650111] Mon, 24 January 2011 09:20 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The following class loading error is particularly interesting:
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.springframework.context.ApplicationContext in KernelBundleClassLoader: [bundle=whale_probe_0.0.0]

as it says that the bundle whale_proble v0 cannot load org.springframework.context.ApplicationContext. This doesn't match the import package statement in the manifest, so it would be worth checking that the correct manifest is being used at runtime.

For instance, if you are deploying via the STS tooling, you may be hitting bug 335008. You can look in the stage directory to see what STS has deployed.

If you are not deploying via STS, I suggest you crack open the bundle you did deploy and check its manifest is as expected.
Re: Upgrading version of spring [message #652179 is a reply to message #649372] Wed, 02 February 2011 21:42 Go to previous messageGo to next message
Raman Gupta is currently offline Raman GuptaFriend
Messages: 12
Registered: December 2010
Junior Member
Here is a little script I use to upgrade Spring 3.0.0 to 3.0.4 in the 2.1.0.RELEASE version:

#!/bin/sh

# This script upgrades the Spring version in the Virgo Kernel or Web Server.
# Applies to a vanilla Virgo Kernel/Web Server v2.1.0.RELEASE instance using Spring 3.0.0
#

if [[ "$VIRGO_HOME" == "" ]]; then
  VIRGO_HOME=/var/tmp/virgo-web-server-2.1.0.RELEASE
fi

if [[ "$SPRING_DIR" == "" ]]; then
  SPRING_DIR=/opt
fi

source_version="3.0.0"
target_version="3.0.4"
target_version_home="$SPRING_DIR/spring-framework-${target_version}.RELEASE/dist"

cd $VIRGO_HOME

for x in $(find . -name "*${source_version}*")
do
  base=$(basename $x)
  base304=$(echo $base | sed -e "s/${source_version}/${target_version}/g")
  if [[ -f $target_version_home/$base304 ]]; then
    rm $x
    cp $target_version_home/$base304 $(dirname $x)
  else
    echo "WARN: $base304 DOES NOT EXIST"
  fi
done

sed -ie "s/${source_version}.RELEASE/${target_version}.RELEASE/g" lib/org.eclipse.virgo.kernel.launch.properties

echo "Done upgrade."


The environment variable SPRING_DIR should be set to the location of the new Spring bin distribution (not including the directory itself). Set VIRGO_HOME to the VWS directory.

It will spit out one or two warnings but works fine for me. YMMV.
Re: Upgrading version of spring [message #652440 is a reply to message #652179] Thu, 03 February 2011 22:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks for sharing this. I'm sure some people will find it useful.
Re: Upgrading version of spring [message #657285 is a reply to message #652179] Wed, 02 March 2011 10:39 Go to previous messageGo to next message
Matt Fellows is currently offline Matt FellowsFriend
Messages: 28
Registered: February 2011
Junior Member
Thanks Raman, this was indeed handy.

Cheers,
Matt
Re: Upgrading version of spring [message #659199 is a reply to message #652440] Fri, 11 March 2011 14:05 Go to previous messageGo to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
I second that, the script is indeed elegant - Cheers

The one issue I faced is that spring-framework-3.0.5.RELEASE does not come with the source bundles in the dist directory, they are now shipped in the src directory. I have attached a modified script that handles this.

Many thank,
Joel

#!/bin/sh

# This script upgrades the Spring version in the Virgo Kernel or Web Server.
# Applies to a vanilla Virgo Kernel/Web Server v2.1.0.RELEASE instance using Spring 3.0.0
#

    if [[ "$VIRGO_HOME" == "" ]]; then
        VIRGO_HOME=$HOME/opt/virgo-web-server-2.1.0.RELEASE
    fi

  if [[ "$SPRING_DIR" == "" ]]; then
    SPRING_DIR=$HOME/Library/spring
  fi

  source_version="3.0.0"
  target_version="3.0.5"
  target_version_dist="$SPRING_DIR/spring-framework-${target_version}.RELEASE/dist "
  target_version_src="$SPRING_DIR/spring-framework-${target_version}.RELEASE/src "

  cd $VIRGO_HOME

  for x in $(find . -name "*${source_version}*")
  do
    base=$(basename $x)
        base_target=$(echo $base | sed -e "s/${source_version}/${target_version}/g")
        if [[ -f $target_version_dist/$base_target ]]; then
            rm $x
            cp $target_version_dist/$base_target $(dirname $x)
        elif [[ -f $target_version_src/$base_target ]]; then
            rm $x
            cp $target_version_src/$base_target $(dirname $x)
        else
            echo "WARN: $target_version_dist/$base_target DOES NOT EXIST"
        fi
    done

    sed -ie "s/${source_version}.RELEASE/${target_version}.RELEASE/g" lib/org.eclipse.virgo.kernel.launch.properties

    echo "Done upgrade."

[Updated on: Fri, 11 March 2011 14:07]

Report message to a moderator

Re: Upgrading version of spring [message #659623 is a reply to message #659199] Mon, 14 March 2011 20:17 Go to previous message
gkontos  is currently offline gkontos Friend
Messages: 10
Registered: January 2011
Junior Member
Wonderful! Adding those spring files to the kernel and updating the launch properties worked for me.

Thanks.
Previous Topic:Eclipse debug hangs when manually stoping bundle from console
Next Topic:Repository takes precedence over stage for bundle selection
Goto Forum:
  


Current Time: Fri Apr 19 21:20:09 GMT 2024

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

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

Back to the top