geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kshiraly <kshiraly.li...@gmail.com>
Subject Geronimo v3 - ClassNotFoundException for class available in sharedlib
Date Mon, 09 Apr 2012 02:02:15 GMT
Hi,

I'm trying to deploy a WAR file in Geronimo v3 JavaEE6 web profile release
(geronimo-tomcat7-javaee6-3.0-beta-1). 
The WAR file's descriptors contain references to JAAS related classes
(roles, principals, login modules) which are available in a JAR file in
GERONIMO_HOME/var/shared/lib. 

This same configuration works in a Geronimo 2.2.1 installation, but shows
the following exception and stack trace in v3 when I copy the WAR file into
Geronimo's hot deployment directory (GERONIMO_HOME/deploy):

=============================================================================
[Loaded org.apache.geronimo.xbeans.geronimo.security.impl.GerRoleTypeImpl
from
file:/D:/developer/geronimo/geronimo-tomcat7-javaee6-3.0-beta-1/var/cache/org.eclipse.osgi/bundles/124/1/bundlefile]
[Loaded org.apache.geronimo.xbeans.geronimo.security.GerPrincipalType from
file:/D:/developer/geronimo/geronimo-tomcat7-javaee6-3.0-beta-1/var/cache/org.eclipse.osgi/bundles/124/1/bundlefile]
[Loaded
org.apache.geronimo.xbeans.geronimo.security.impl.GerPrincipalTypeImpl from
file:/D:/developer/geronimo/geronimo-tomcat7-javaee6-3.0-beta-1/var/cache/org.eclipse.osgi/bundles/124/1/bundlefile]
[Loaded org.apache.geronimo.security.util.ConfigurationUtil$1 from
file:/D:/developer/geronimo/geronimo-tomcat7-javaee6-3.0-beta-1/var/cache/org.eclipse.osgi/bundles/87/1/bundlefile]
java.security.PrivilegedActionException: java.lang.ClassNotFoundException:
com.liferay.portal.kernel.security.jaas.PortalRole
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.geronimo.security.util.ConfigurationUtil.generatePrincipal(ConfigurationUtil.java:77)
	at
org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl.buildPrincipal(GeronimoSecurityBuilderImpl.java:280)
	at
org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl.configureRoleMapper(GeronimoSecurityBuilderImpl.java:314)
	at
org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl.build(GeronimoSecurityBuilderImpl.java:184)
	at
org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection.build(NamespaceDrivenBuilderCollection.java:43)
	at
org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.basicInitContext(AbstractWebModuleBuilder.java:496)
	at
org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.initContext(AbstractWebModuleBuilder.java:436)
	at
org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.initContext(SwitchingModuleBuilder.java:168)
	at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:685)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:140)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
	at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
	at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException:
com.liferay.portal.kernel.security.jaas.PortalRole
	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.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at
org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
	at
org.apache.geronimo.security.util.ConfigurationUtil$1.run(ConfigurationUtil.java:79)
	at
org.apache.geronimo.security.util.ConfigurationUtil$1.run(ConfigurationUtil.java:77)
	... 23 more

=============================================================================



*var/config/config.xml has entries for sharedlib:*

    <module
name="org.apache.geronimo.configs/sharedlib-extender/3.0-beta-1/car"/>
    <module name="org.apache.geronimo.configs/sharedlib/3.0-beta-1/car"/>


*WAR file's geronimo-web.xml:*

<?xml version="1.0"?>

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
	<environment>
		<moduleId>
			<groupId>liferay</groupId>
			<artifactId>liferay-portal</artifactId>
			<version>6.1.0</version>
			<type>car</type>
		</moduleId>
		<dependencies>
			<dependency>
				<groupId>org.apache.geronimo.configs</groupId>
				<artifactId>j2ee-server</artifactId>
				<type>car</type>
			</dependency>
			<dependency>
				<groupId>org.apache.geronimo.configs</groupId>
				<artifactId>sharedlib</artifactId>
				<type>car</type>
			</dependency>
			<dependency>
				<groupId>org.apache.geronimo.framework</groupId>
				<artifactId>j2ee-security</artifactId>
				<type>car</type>
			</dependency>
			<dependency>
				<groupId>org.apache.geronimo.framework</groupId>
				<artifactId>rmi-naming</artifactId>
				<type>car</type>
			</dependency>
		</dependencies>
		
	</environment>
	<context-root>/</context-root>
	<security-realm-name>PortalRealm</security-realm-name>
	<security>
		<default-principal>
			<principal name="anonymous"
class="com.liferay.portal.kernel.security.jaas.PortalPrincipal" />
		</default-principal>
		<role-mappings>
			<role role-name="users">
				<principal class="com.liferay.portal.kernel.security.jaas.PortalRole"
name="users" />
			</role>
		</role-mappings>
	</security>
	<gbean name="PortalRealm"
class="org.apache.geronimo.security.realm.GenericSecurityRealm">
		<attribute name="realmName">PortalRealm</attribute>
		<reference name="ServerInfo">
			<name>ServerInfo</name>
		</reference>
		
		<xml-reference name="LoginModuleConfiguration">
			<log:login-config
xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
				<log:login-module control-flag="REQUIRED" wrap-principals="false">
					<log:login-domain-name>PortalRealm</log:login-domain-name>
				
<log:login-module-class>com.liferay.portal.security.jaas.ext.tomcat.PortalLoginModule</log:login-module-class>
				</log:login-module>
			</log:login-config>
		</xml-reference>
	</gbean>
</web-app>

*Other information: *
For the record, the WAR file I'm trying to deploy is liferay-portal.war.
Liferay comes with a Geronimo bundle for Geronimo v2.2.1. 
I wanted to try out a similar deployment on Geronimo v3. 
A diff utility run on liferay+geronimo2.2.1 bundle and a normal
geronimo2.2.1 download showed that Liferay has made only 2 additions - 1)
Added all liferay WARs in /deploy 2) Added all shared JARs in
/var/shared/lib. All other changes are disabling and removal of services
like openejb which liferay does not use.
The same deployment in Geronimo v3 throws ClassNotFoundException. Does the
OSGI support in v3 require some additional configuration for sharedlib?

Thanks
kshiraly

--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Geronimo-v3-ClassNotFoundException-for-class-available-in-sharedlib-tp3895754p3895754.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message