Results 1 to 10 of 25

Thread: Spring2 + EJB3 + JBoss405

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Nice, France
    Posts
    24

    Default Spring2 + EJB3 + JBoss405

    Hello,

    I've been trying to use a SLSB from a Stripes ActionBean, but for some reason it doesn't work. Checking the JMX console, the SLSB looks correctly deployed, so I guess it's a matter of Spring configuration.

    Code:
    	<!-- Security service EJB -->
    	<bean id="securityServiceEjb" class="org.springframework.jndi.JndiObjectFactoryBean">
    	   	<property name="jndiEnvironment">
    	   		<props>
    	   			<prop key="java.naming.factory.initial">
    	   				org.jnp.interfaces.NamingContextFactory
    	   			</prop>
    	   			<prop key="java.naming.factory.url.pkgs">
    	   				org.jboss.naming:org.jnp.interfaces
    	   			</prop>
    	   			<prop key="java.naming.provider.url">
    	   				jnp://localhost:1099
    	   			</prop>
    	   		</props>
    	   	</property>
    		<property name="jndiName" value="schlange-security/SecurityServiceEjb/local" />
    		<property name="proxyInterface" value="org.schlange.security.server.SecurityService" />
    		<property name="lookupOnStartup" value="false" />
    	</bean>
    Code:
    20:36:45,062 INFO  [STDOUT] ERROR 08:36:45 org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/mpc].[StripesDispatcher].error(L119) - Servlet.service() for servlet StripesDispatcher threw exception
    java.lang.IllegalArgumentException: object is not an instance of declaring class
    	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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
    	at $Proxy75.login(Unknown Source)
    	at org.mpc.web.controller.user.LoginActionBean.confirm(LoginActionBean.java:56)
    I saw other posts concerning this issue, but I couldn't find out a way to get this issue solved yet.

    Can anybody give me a hand here, please?

    Thanks in advance!

  2. #2

    Default

    I have the same issue (see my topic). JndiObjectFactoryBean doesn't work for me. One guy claims that Spring JBoss Deployer helps to solve it but I don't know how (from what it seems the JBoss deployer allows deployment of .spring files, but how may it help)

  3. #3
    Join Date
    Jul 2005
    Location
    Nice, France
    Posts
    24

    Default

    Well, I guess I'll try JBoss deployer or another technique then. It's a pity JndiObjectFactoryBean doesn't work as expected in this case, since it's so clean...

    As soon as I get this thing working, I'll let you know in this post. Thanks!

  4. #4
    Join Date
    Dec 2006
    Location
    Normal, Illinois
    Posts
    277

    Default

    Have you tried removing the proxyInterface?

    Code:
    <property name="proxyInterface" value="org.schlange.security.server.SecurityService" />
    If you remove this it will just do a lookup of the object and return it as an object. This might help you move forward because the problem is in the AOP proxy that gets built when you provide the interface. It seem as if the error is indicating that the object that is returned from the JNDI lookup does not implement the 'org.schlange.security.server.SecurityService' interface.
    Caleb Washburn

  5. #5
    Join Date
    Dec 2005
    Location
    U-241
    Posts
    237

    Default

    JndiObjectFactoryBean works just fine
    in my JBoss 4.0.4 + Spring 2 + JBoss-Spring integration package from Ales Justin and co
    http://www.jboss.org/index.html?modu...iewforum&f=223
    Spring, it's a wonderful thing...

  6. #6

    Default

    Tell me, in what way does JBoss Spring deployer help here? I don't want to package into .spring file.

    Cheers,
    Leet Geezer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •