This discussion is archived
3 Replies Latest reply: Dec 2, 2011 6:03 AM by user335369 - oracle RSS

Integrating Spring and WebLogic 10.3

900179 Newbie
Currently Being Moderated
I'm trying to configure WebLogic 10.3.2.0 to use WebLogic resources for a Spring application, as described in the WebLogic docs (http://download.oracle.com/docs/cd/E12839_01/web.1111/e14453/toc.htm). My goal is for EJB 3 beans to be able to refer to Spring beans and vice versa. Also, I prefer using @Inject and other standard annotations and types, as opposed to Spring-specific types like SpringBeanAutowiringInterceptor.

Unfortunately, the WebLogic Spring docs are old (copyright 2009) and in need of an update. For example, the instructions include a step to download pitchfork.jar, which only supports Spring 2.0. WebLogic 10.3 includes a repackaged pitchfork.jar, but I don't know which Spring version it supports. The WebLogic docs also mention a class org.springframework.jee.interfaces.SpringComponentFactory, which does not exist in the new pitchfork.jar; instead, the class is com.oracle.interfaces.SpringComponentFactory.

I've tried different permutations of the steps on http://download.oracle.com/docs/cd/E12839_01/web.1111/e14453/enable_spring.htm#CHDIIIGJ: adding a <component-factory-class-name>com.oracle.interfaces.SpringComponentFactory</component-factory-class-name> element to weblogic-application.xml, weblogic-ejb-jar.xml, and weblogic.xml; modifying the WebLogic classpath to include the jars for Spring 2.5 and Spring 3.0; etc. But in all cases, application deployment fails with a NullPointerException in weblogic.ejb.container.deployer.EJBDeployer.prepare(). I don't have access to the WebLogic source, so I don't know what's causing the NPE.

Has anyone successfully integrated Spring 2.5 or Spring 3.0 and WebLogic 10.3? If so, how is your configuration different from the config described in the WebLogic docs?

Thanks,
Mike
  • 1. Re: Integrating Spring and WebLogic 10.3
    RenévanWijk Oracle ACE
    Currently Being Moderated
    Not with EJB's but just Spring. An example is given here: http://middlewaremagic.com/weblogic/?p=7478

    An example to integrate Spring with EJB is given here: http://static.springsource.org/spring/docs/2.5.x/reference/ejb.html
  • 2. Re: Integrating Spring and WebLogic 10.3
    900179 Newbie
    Currently Being Moderated
    Thanks for the reply, René. The problem is the Spring/EJB integration. WebLogic claims to support it but I think that is no longer true. So I'm looking for the least intrusive Plan B. I'd prefer not to use SpringBeanAutowiringInterceptor but that may be the cleanest solution.

    Regards,
    Mike
  • 3. Re: Integrating Spring and WebLogic 10.3
    user335369 - oracle Newbie
    Currently Being Moderated
    Hi,

    I am also facing same error.

    ============
    weblogic.xml
    ============
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <context-root>MyApp</context-root>
         <component-factory-class-name>com.oracle.pitchfork.interfaces.SpringComponentFactory</component-factory-class-name>
    </weblogic-web-app>

    and when I try to deploy my war file its giving error.

         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused By: java.lang.NullPointerException
         at weblogic.servlet.internal.WebComponentContributor.<init>(WebComponentContributor.java:73)
         at weblogic.servlet.internal.WebAppServletContext.processAnnotations(WebAppServletContext.java:1385)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:449)
         at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:493)
         at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
         at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:972)
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:382)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    >

    please help !

    regards

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points