[JNDI/Naming/Network] - Re: Standalone client getting errors while attempting to acc
by goja
Thanks for your help but it doesn't work yet.
anonymous wrote : All you have to do is, make sure that the standalone client has the appropriate JBoss jar file(s) in its classpath.
I found the HiLoKeyGeneratorFactory class in a uuid-key-generator.sar directory under the default deployment directory. I also had to add the jboss-server.jar.
It looks like a JBoss standalone client cannot browse the JNDI binding because of a dependency of the client jars on a sar and jboss-server.jar, which in turns throws an exception complaining about "No 'jboss' MBeanServer found!".
Any other ideas?
Stack traces below:
Error with jbossall-client.jar added to classpath:
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory (no security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:966)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:915)
at javax.naming.InitialContext.listBindings(InitialContext.java:406)
at test.ListJNDIBindingsWithClientJars.main(ListJNDIBindingsWithClientJars.java:22)
Caused by: java.lang.ClassNotFoundException: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:962)
... 3 more
After adding the sar containing the missing HiLoKeyGeneratorFactory class we get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBeanSupport
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:154)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:962)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:915)
at javax.naming.InitialContext.listBindings(InitialContext.java:406)
at test.ListJNDIBindingsWithClientJars.main(ListJNDIBindingsWithClientJars.java:22)
After adding the jboss-system.jar containing the ServiceMBeanSupport class we get the following error:
Exception in thread "main" java.lang.IllegalStateException: No 'jboss' MBeanServer found!
at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:122)
at org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory.readObject(HiLoKeyGeneratorFactory.java:438)
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:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:962)
at org.jnp.interfaces.NamingContext.listBindings(NamingContext.java:915)
at javax.naming.InitialContext.listBindings(InitialContext.java:406)
at test.ListJNDIBindingsWithClientJars.main(ListJNDIBindingsWithClientJars.java:22)
| public class ListJNDIBindings {
|
| public static void main(String[] args) {
|
| Properties props = new Properties();
| props.put(Context.INITIAL_CONTEXT_FACTORY, org.jnp.interfaces.NamingContextFactory.class.getName());
| props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
|
| try {
| Context context = new InitialContext(props);
| NamingEnumeration<Binding> ne = context.listBindings("");
| while (ne.hasMore()) {
| System.out.println(ne.nextElement());
| }
| } catch (NamingException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112347#4112347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112347
18 years, 4 months
[JBoss Seam] - WAR only: Seam 2.0.0.0GA + Maven2 doesn`t work...
by jsolderitsch
I have followed I think the advice that has been given in this thread but I am in a simpler situation -- only one pom for a single war deployment.
I copied in dependencies from the examples I have seen in this thread and gotten mvn install to produce a war file.
When I go to deploy it, JBoss shows:
| 14:14:37,619 INFO [TomcatDeployer] deploy, ctxPath=/TestSeam, warUrl=.../tmp/deploy/tmp57916TestSeam-exp.war/
| 14:14:37,930 ERROR [[/TestSeam]] Exception starting filter Seam Filter
| java.lang.ClassCastException: org.jboss.seam.servlet.SeamFilter
| at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
| at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
| at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
| at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3722)
|
My dependency section of the pom looks like:
| <dependency>
| <groupId>org.jboss.seam</groupId>
| <artifactId>jboss-seam</artifactId>
| <version>2.0.0.GA</version>
| </dependency>
| <dependency>
| <groupId>junit</groupId>
| <artifactId>junit</artifactId>
| <version>3.8.1</version>
| <scope>test</scope>
| </dependency>
| <dependency>
| <groupId>org.jboss.seam</groupId>
| <artifactId>jboss-seam-debug</artifactId>
| <version>2.0.0.GA</version>
| </dependency>
| <dependency>
| <groupId>org.jboss.seam</groupId>
| <artifactId>jboss-seam-ui</artifactId>
| <version>2.0.0.GA</version>
| </dependency>
| <dependency>
| <groupId>org.jboss.seam</groupId>
| <artifactId>jboss-el</artifactId>
| <version>2.0.0.GA</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>javax.el</groupId>
| <artifactId>el-api</artifactId>
| <version>1.0</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>javax.faces</groupId>
| <artifactId>jsf-api</artifactId>
| <version>1.2_04-p02</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>javax.persistence</groupId>
| <artifactId>persistence-api</artifactId>
| <version>1.0</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>org.hibernate</groupId>
| <artifactId>hibernate-validator</artifactId>
| <version>3.0.0.GA</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <!--<groupId>jboss</groupId>-->
| <groupId>org.jboss.javaee</groupId>
| <artifactId>jboss-ejb-api</artifactId>
| <!--<version>4.2.1.GA</version>-->
| <version>3.0.0.20070913080910</version>
| <scope>provided</scope>
| </dependency>
|
Can anyone see what I am doing wrong. Seam and maven newbie!
The code I am adapting came out of seam-gen so the java class code is all generated stuff from seam-gen.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112341#4112341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112341
18 years, 4 months
[JBoss Seam] - Re: Component abstraction*
by jacob.orshalick
anonymous wrote : I would like to create, if possible of course, an interface as a component. And use this to control the tasks of my business process. Depending on the implementation of such interface that is deployed, actions would behave differently.
It is not possible to directly define an interface as a Seam component, but it is possible to have your components implement a common interface and refer to that interface where your component is used. This is definitely recommended to allow differing implementations to be swapped out as you describe.
Thus, if you have a component:
...
| @Name("hookComponent")
| public class HookComponentImpl implements HookComponent {
| ...
You tie your use of the component to the interface just like you would when injecting an SFSB:
...
| @Name("commonComponent")
| public class CommonComponent {
| ...
| @In HookComponent hookComponent;
| ...
Here Seam will inject an instance of HookComponentImpl as it is the component registered in the context but this could easily be swapped out through a number of approaches (deploying a specific application instance as you describe, install precedence, configuration through components.xml, etc). Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112328#4112328
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112328
18 years, 4 months