Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo + Spring Security + EHCache(Classloader issue)
Virgo + Spring Security + EHCache [message #793096] Tue, 07 February 2012 14:26 Go to next message
Paul Watson is currently offline Paul Watson
Messages: 12
Registered: July 2009
Junior Member
Hi all,

I am trying to use Spring Security + EHCache to speed up authentication (I am using this with secured spring remoting, so I want to speed up the authentication as much as possible).

Everything works fine until I tried to add in the caching functionality where I run in to some class loader issues. I added the following bundles to the usr directory which seem to satisfy all the dependencies of ehcache.

com.springsource.net.sf.ehcache-2.0.0.jar
com.springsource.org.codehaus.btm-1.3.3.jar
com.springsource.org.hibernate-3.3.2.GA.jar
com.springsource.antlr-2.7.7.jar
com.springsource.javassist-3.12.1.GA.jar
com.springsource.net.sf.cglib-2.2.0.jar
com.springsource.org.apache.commons.collections-3.2.1.jar
com.springsource.org.dom4j-1.6.1.jar
com.springsource.org.objectweb.asm-1.5.3.jar

I also added the com.springsource.net.sf.ehcache as an imported bundle to the web application bundle.

On starting up the web server I get an exception (shown) when parsing the applicationContext.xml. It seems that the spring security core bundle cannot load the net.sf.ehcache.CacheException class. I cracked open the spring security core bundle to look at the manifest and is does have the ehcache stuff listed as an optional dependency.

Does anyone have any thoughts on how to fix this?

Many thanks,



Paul



[2012-02-07 10:59:23.723] ERROR Thread-68 org.springframework.web.context.ContextLoader Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userCache' while setting bean property 'userCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$301(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$1.run(AbstractDelegatedExecutionApplicationContext.java:186)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:182)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:89)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userCache' while setting bean property 'userCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:274)
... 29 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userCache' while setting bean property 'userCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.security.config.authentication.AuthenticationManagerFactoryBean.getObject(AuthenticationManagerFactoryBean.java:27)
at org.springframework.security.config.authentication.AuthenticationManagerFactoryBean.getObject(AuthenticationManagerFactoryBean.java:20)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 31 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userCache' while setting bean property 'userCache'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 45 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userCache' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 55 common frames omitted
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:65)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
... 63 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: net.sf.ehcache.CacheException in KernelBundleClassLoader: [bundle=org.springframework.security.core_3.0.4.RELEASE]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 69 common frames omitted
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
... 70 common frames omitted


Here is the relevant part of the applicationContext.xml

<security:http auto-config="true" >
<security:http-basic/>
<security:intercept-url pattern="/SecurityRemoteService" access="ROLE_ADMIN" />
</security:http>

<security:authentication-manager>
<security:authentication-provider>
<security:password-encoder hash="md5" />
<security:jdbc-user-service
data-source-ref="dataSource"
users-by-username-query=
"select username, fingerprint as password, 1 as enabled from users where username = ?"
authorities-by-username-query="
select u.username, r.role as authorities
from users u, roles r
where u.username = ? and u.user_id = r.user_id"
cache-ref="userCache" />
</security:user-service>-->
</security:authentication-provider>
</security:authentication-manager>

<beans:bean id="userCache" class="org.springframework.security.core.userdetails.cache.EhCacheBasedUserCache">
<beans:property name="cache" ref="userEhCache" />
</beans:bean>

<beans:bean id="userEhCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<beans:property name="cacheManager" ref="cacheManager" />
<beans:property name="cacheName" ref="userCache" />
</beans:bean>


Re: Virgo + Spring Security + EHCache [message #793119 is a reply to message #793096] Tue, 07 February 2012 14:59 Go to previous messageGo to next message
Paul Watson is currently offline Paul Watson
Messages: 12
Registered: July 2009
Junior Member
Here is some output from the OSGI console. The required bundles all seem to be active.

Thanks,


Paul

id State Bundle
0 ACTIVE org.eclipse.osgi_3.7.0.v20110613
41 ACTIVE org.eclipse.virgo.kernel.userregionfactory_3.0.2.RELEASE
48 ACTIVE org.eclipse.equinox.cm_1.0.300.v20101204
49 ACTIVE org.eclipse.virgo.kernel.userregion_3.0.2.RELEASE
50 ACTIVE org.eclipse.virgo.kernel.osgicommand_3.0.2.RELEASE
51 ACTIVE org.eclipse.osgi.services_3.3.0.v20110110
52 ACTIVE com.springsource.org.apache.mina.core_2.0.2
53 ACTIVE org.apache.felix.gogo.command_0.8.0.v201105062003
54 ACTIVE org.apache.felix.gogo.runtime_0.8.0.v201105062003
55 ACTIVE org.apache.felix.gogo.shell_0.8.0.v201107131313
56 ACTIVE org.eclipse.equinox.console.supportability_1.0.0.201108021516
57 ACTIVE com.springsource.org.apache.sshd.core_0.5.0
58 ACTIVE org.springframework.osgi.core_1.2.1
59 ACTIVE org.springframework.osgi.extender_1.2.1
Fragments=94
60 ACTIVE org.springframework.osgi.io_1.2.1
61 ACTIVE org.eclipse.virgo.kernel.agent.dm_3.0.2.RELEASE
62 ACTIVE org.eclipse.virgo.kernel.deployer.dm_3.0.2.RELEASE
63 ACTIVE org.eclipse.equinox.ds_1.3.0.v20110124-0830
64 ACTIVE org.eclipse.equinox.util_1.0.200.v20100503
65 ACTIVE com.oracle.jdbc_1.0.0
66 ACTIVE com.springsource.antlr_2.7.7
67 ACTIVE com.springsource.javassist_3.12.1.GA
68 ACTIVE com.springsource.javax.ejb_3.0.0
69 ACTIVE com.springsource.javax.jms_1.1.0
70 ACTIVE com.springsource.javax.mail_1.4.0
71 ACTIVE com.springsource.javax.persistence_1.0.0
72 ACTIVE com.springsource.javax.portlet_2.0.0.v20110525
73 ACTIVE com.springsource.javax.xml.rpc_1.1.0.v20110517
74 ACTIVE com.springsource.net.sf.cglib_2.2.0
75 ACTIVE com.springsource.org.aopalliance_1.0.0
76 ACTIVE com.springsource.org.apache.commons.codec_1.3.0
77 ACTIVE com.springsource.org.apache.commons.collections_3.2.1
78 ACTIVE com.springsource.org.apache.commons.fileupload_1.2.0.v20110525
79 ACTIVE com.springsource.org.apache.commons.httpclient_3.1.0
80 ACTIVE com.springsource.org.apache.commons.io_1.4.0
81 ACTIVE com.springsource.org.apache.commons.pool_1.3.0
82 ACTIVE com.springsource.org.dom4j_1.6.1
83 ACTIVE com.springsource.org.eclipse.persistence_1.0.0
Fragments=86
84 ACTIVE com.springsource.org.eclipse.persistence.antlr_1.0.0
85 ACTIVE com.springsource.org.eclipse.persistence.asm_1.0.0
86 RESOLVED com.springsource.org.eclipse.persistence.jpa_1.0.0
Master=83
87 ACTIVE com.springsource.org.h2_1.0.71
88 ACTIVE com.springsource.org.hibernate_3.3.2.GA
89 ACTIVE com.springsource.org.objectweb.asm_1.5.3
90 ACTIVE com.springsource.slf4j.org.apache.log4j_1.6.1
91 ACTIVE javax.el_2.2.0.v201105051105
92 ACTIVE javax.servlet_3.0.0.v201103241009
93 ACTIVE javax.servlet.jsp_2.2.0.v201103241009
94 RESOLVED org.eclipse.virgo.kernel.dmfragment_3.0.2.RELEASE
Master=59
95 ACTIVE org.springframework.aop_3.0.5.RELEASE
96 ACTIVE org.springframework.asm_3.0.5.RELEASE
97 ACTIVE org.springframework.beans_3.0.5.RELEASE
98 ACTIVE org.springframework.context_3.0.5.RELEASE
99 ACTIVE org.springframework.core_3.0.5.RELEASE
100 ACTIVE org.springframework.expression_3.0.5.RELEASE
101 ACTIVE org.springframework.jdbc_3.0.5.RELEASE
102 ACTIVE org.springframework.orm_3.0.5.RELEASE
103 ACTIVE org.springframework.oxm_3.0.5.RELEASE
104 ACTIVE org.springframework.transaction_3.0.5.RELEASE
105 ACTIVE org.springframework.web_3.0.5.RELEASE
106 ACTIVE org.eclipse.gemini.web.core_2.0.1.RELEASE
107 ACTIVE org.eclipse.gemini.web.tomcat_2.0.1.RELEASE
Fragments=110
108 ACTIVE org.eclipse.virgo.web.core_3.0.2.RELEASE
109 ACTIVE org.eclipse.virgo.web.dm_3.0.2.RELEASE
110 RESOLVED org.eclipse.virgo.web.tomcat.support_3.0.2.RELEASE
Master=107
111 ACTIVE com.springsource.org.apache.catalina_7.0.21
Fragments=112, 113, 114, 116, 119
112 RESOLVED com.springsource.org.apache.catalina.ha_7.0.21
Master=111
113 RESOLVED com.springsource.org.apache.catalina.tribes_7.0.21
Master=111
114 RESOLVED com.springsource.org.apache.coyote_7.0.21
Master=111
115 ACTIVE com.springsource.org.apache.el_7.0.21
116 RESOLVED com.springsource.org.apache.jasper_7.0.21
Master=111
117 ACTIVE com.springsource.org.apache.juli.extras_7.0.21
118 ACTIVE com.springsource.org.apache.tomcat.api_7.0.21
119 RESOLVED com.springsource.org.apache.tomcat.util_7.0.21
Master=111
120 ACTIVE com.springsource.org.eclipse.jdt.core.compiler.batch_3.6.1
121 ACTIVE javax.annotation_1.1.0.v201105051105
122 ACTIVE org.eclipse.virgo.snaps.api_3.0.2.RELEASE
123 ACTIVE org.eclipse.virgo.snaps.core_3.0.2.RELEASE
124 ACTIVE org.eclipse.virgo.apps.admin.core_3.0.2.RELEASE
125 ACTIVE org.eclipse.virgo.apps.admin.web_3.0.2.RELEASE
126 ACTIVE com.springsource.freemarker_2.3.18
127 ACTIVE com.springsource.javax.servlet.jsp.jstl_1.2.0.v20110728
128 ACTIVE com.springsource.net.sf.ehcache_2.0.0
129 ACTIVE com.springsource.org.codehaus.btm_1.3.3
130 ACTIVE org.springframework.context.support_3.0.5.RELEASE
131 ACTIVE org.springframework.web.servlet_3.0.5.RELEASE
132 ACTIVE org.eclipse.virgo.apps.repository-3.0.2.RELEASE-org.eclipse.virgo.apps.repository.core_3.0.2.RELEAS
133 ACTIVE org.eclipse.virgo.apps.repository-3.0.2.RELEASE-org.eclipse.virgo.apps.repository.web_3.0.2.RELEASE
134 ACTIVE org.eclipse.virgo.apps.repository-3.0.2.RELEASE-synthetic.context_3.0.2.RELEASE
135 ACTIVE org.eclipse.virgo.apps.splash_3.0.2.RELEASE
136 ACTIVE org.eclipse.virgo.snaps.sample.animal_3.0.2.RELEASE
137 ACTIVE com.springsource.org.apache.taglibs.standard_1.1.2.v20110517
138 ACTIVE org.eclipse.virgo.snaps.sample.dog_3.0.2.RELEASE
139 ACTIVE com.minidb.datasource.oracle_1.0.0
140 ACTIVE com.springsource.org.apache.commons.dbcp_1.2.2.osgi
141 ACTIVE org.springframework.aspects_3.0.5.RELEASE
142 ACTIVE org.springframework.jms_3.0.5.RELEASE
143 ACTIVE org.springframework.web.portlet_3.0.5.RELEASE
144 ACTIVE com.minidb.domain_1.0.0
145 ACTIVE com.minidb.service_1.0.0
146 ACTIVE com.minidb.service.datasource.oracle_1.0.0
147 ACTIVE org.springframework.security.core_3.0.4.RELEASE
148 ACTIVE com.minidb.web_1.0.0
150 ACTIVE org.springframework.security.config_3.0.4.RELEASE
151 ACTIVE org.springframework.security.web_3.0.4.RELEASE
152 ACTIVE com.oracle.jdbc_1.0.0
osgi>
Re: Virgo + Spring Security + EHCache [message #793328 is a reply to message #793119] Tue, 07 February 2012 21:26 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
Can you post your MANIFEST.MF?

Thanks
Dmitry
Re: Virgo + Spring Security + EHCache [message #793556 is a reply to message #793328] Wed, 08 February 2012 04:32 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
This FAQ may be helpful.
Re: Virgo + Spring Security + EHCache [message #793953 is a reply to message #793556] Wed, 08 February 2012 14:22 Go to previous messageGo to next message
Paul Watson is currently offline Paul Watson
Messages: 12
Registered: July 2009
Junior Member
Hi Dmitry,

Here is the manifest for the web application bundle. I'll check out the FAQ as well.

Manifest-Version: 1.0
Class-Path:
Bundle-ClassPath: ., WEB-INF/classes
Bundle-Version: 1.0.0
Bundle-Name: MiniDB Web Remoting Bundle
Bundle-ManifestVersion: 2
Bundle-Description: MINIDB Remoting
Bundle-SymbolicName: com.minidb.web.remoting
Import-Package: com.minidb.domain,
com.minidb.service,
com.minidb.service.datasource.oracle,
javax.servlet.http;version="[3.0.0,3.0.0]",
javax.servlet.jsp.jstl.core;version="[1.2.0.v20110728,1.2.0.v20110728]",
javax.servlet.jsp.tagext;version="[2.2.0,2.2.0]",
javax.sql,
org.apache.commons.dbcp;version="[1.2.2.osgi,1.2.2.osgi]",
org.apache.commons.pool;version="[1.3.0,1.3.0]",
org.apache.shiro.web.tags,
org.eclipse.virgo.web.dm;version="[3.0.2.RELEASE,3.0.2.RELEASE]"
Import-Bundle: com.oracle.jdbc;version="[1.0.0,1.0.0]",
com.minidb.datasource.oracle;version="[1.0.0,1.0.0]",
org.springframework.jdbc;version="[3.0.5.RELEASE,3.0.5.RELEASE]",
org.springframework.security.config;version="[3.0.4.RELEASE,3.0.4.RELEASE]",
org.springframework.security.web;version="[3.0.4.RELEASE,3.0.4.RELEASE]",
org.springframework.security.core;version="[3.0.4.RELEASE,3.0.4.RELEASE]",
org.apache.shiro;version="[1.0.0,1.0.0]",
com.springsource.org.apache.taglibs.standard;version="[1.1.2.v20110517,1.1.2.v20110517]",
com.springsource.net.sf.ehcache;version="[2.0.0,2.0.0]"
Import-Library: org.springframework.spring;version="[3.0.5.RELEASE,3.0.5.RELEASE]"
Export-Package: com.minidb.web.remoting


Re: Virgo + Spring Security + EHCache [message #794191 is a reply to message #793953] Wed, 08 February 2012 21:05 Go to previous messageGo to next message
Paul Watson is currently offline Paul Watson
Messages: 12
Registered: July 2009
Junior Member
Hi there,

I switched from Spring Security to Apache Shiro (which has the option of using EhCache, which I have enabled). In this case I create a bundle from the shiro jar files and added an explicit dependency on the com.springsource.net.sf.ehcache bundle. This seems to have made everything work perfectly. I looked at the class loading with osgi console cl commands and everything seems to be loading properly (as you would expect).

The only difference I can see in the 2 situations is that the spring security core bundle only lists the ehcache bundle as an optional dependency.

Thanks for the help.


Paul


Re: Virgo + Spring Security + EHCache [message #794223 is a reply to message #794191] Wed, 08 February 2012 22:16 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
spring security core imports ehcache as optional but also with version range that excludes 2.0.0

net.sf.ehcache 	[1.4.1, 2.0.0)


http://ebr.springsource.com/repository/app/bundle/version/detail?name=org.springframework.security.core&version=3.0.4.RELEASE

Look in Imported Packages section.

Try to downgrade ehcache to 1.6.2.
Re: Virgo + Spring Security + EHCache [message #795746 is a reply to message #794223] Fri, 10 February 2012 17:11 Go to previous message
Paul Watson is currently offline Paul Watson
Messages: 12
Registered: July 2009
Junior Member
I see. I thought the version range was inclusive. I'll try that out.
Previous Topic:First Virgo SNAP with JSF
Next Topic:spring dm test startup failes
Goto Forum:
  


Current Time: Wed Jul 30 19:20:16 EDT 2014

Powered by FUDForum. Page generated in 0.09303 seconds