0

JBoss 6.0 AS and ZK CDI

asked 2011-02-02 14:35:54 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

Dear all,
i have setup a project for use with zk.I was previously working and doing all DI via spring.Now moving on to j2ee 6 i would like to minimize dependencies, but i have the following problem:
Create maven project with the required dependencies.
Then i add in web.xml of my application the necessary entries as i found them over the tutorial.(i.e. adding beans.xml + context.xml with the BeanManager definition)
but when the application start to deploy in jboss i get the error of a classcastexception since instead of using interfaces i think they use implementations which shouldn't be the case.Any suggestion?

best regards
Nick

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-02-02 17:36:58 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

Ok i am spamming but what is happening men...i can see that slf4j is different and i can't discover the version of slf4j you want to use in order to import it.

Error installing to Instantiated: name=vfs:///home/cirix/Programs/jboss-6.0.0.Final/server/default/deploy/3/mcube-console.war_WeldBootstrap state=Described: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature

Any suggestions?

link publish delete flag offensive edit

answered 2011-02-03 10:42:40 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

My General question is:"Has anyone manage to deploy successfully and application with zkcdi in JBoss 6.0"?

link publish delete flag offensive edit

answered 2011-02-04 09:48:33 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

So i have the problem solved. Still there are some dependencies in zkcdi that must be removed and try instead of using implementations to use API.What is called Interface based design.

link publish delete flag offensive edit

answered 2011-02-04 10:09:54 +0800

nmpallas gravatar image nmpallas
115 4
http://nmpallas.wordpress...

updated 2011-02-04 10:10:33 +0800

So here are the dependencies that are required for a project to be deployed successfully in JBoss.Please take into account that the weld-servlet.jar has a dependency to the StaticLoggerBinder.class which is also available in JBoss. In order to solve the problem the class loader isolation can be used in order to avoid errors.here is my pom.xml.Please also take into account that the definition of the weld servlet in JBoss 6 isn't need it for obvious reasons.The only thing that is necessary is the context.xml inside the META-INF folder with the binding of the BeanManager as described in the 2 tutorials available in ZK blog and smalltalk. I think the next
thing is patching and recommitting zkcdi. The entire framework is using mostly a portion of the JSR-229 and focuses in the use of Annotation Qualifiers. Hope i will find some time to extend it with other features i have in mind. Hope this will help somebody. I use maven but since the zkcdi isn't available in some official repository i have imported locally.

build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
				<version>2.3.2</version>
			</plugin>
			<plugin>
				<groupId>org.codehaus.cargo</groupId>
				<artifactId>cargo-maven2-plugin</artifactId>
				<version>1.0.4</version>
				<extensions>true</extensions>
				<configuration>
					<descriptor>merge.xml</descriptor>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<!-- Dependencies -->
	<dependencies>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zk</artifactId>
			<version>5.0.5</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.common</groupId>
			<artifactId>zcommon</artifactId>
			<version>5.0.5</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.common</groupId>
			<artifactId>zweb</artifactId>
			<version>5.0.5</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zul</artifactId>
			<version>5.0.5</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zkcdi</artifactId>
			<version>1.0</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zkforge.el</groupId>
			<artifactId>zcommons-el</artifactId>
			<version>1.0.2</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.google</groupId>
			<artifactId>reflections</artifactId>
			<version>0.9.5-RC1</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<!-- dependency>
			<groupId>com.google.collections</groupId>
			<artifactId>google-collections</artifactId>
			<version>1.0-rc3</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.weld</groupId>
			<artifactId>weld-core</artifactId>
			<version>1.0.1-Final</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.interceptor</groupId>
			<artifactId>jboss-interceptor</artifactId>
			<version>CR11</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency-->
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<version>1.0-SP1</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.weld.servlet</groupId>
			<artifactId>weld-servlet</artifactId>
			<version>1.0.1-Final</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zkplus</artifactId>
			<version>5.0.5</version>
			<type>pom</type>
			<scope>compile</scope>
		</dependency>
	</dependencies>

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-02 14:35:54 +0800

Seen: 643 times

Last updated: Feb 04 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More