Weblogic cluster URL not working
Hi
we have the following definition for a jndiTemplate:
Code:
<!-- remote access to weblogic JNDI -->
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://10.23.224.22,10.23.224.23:7007</prop>
<prop key="java.naming.security.principal"></prop>
<prop key="java.naming.security.credentials"></prop>
</props>
</property>
</bean>
this template is injected to an EJB:
Code:
<bean id="AlertServiceEJB" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName" value="AlertServiceWrapper"/>
<property name="businessInterface" value="com.itp.gt.alert.ejb.AlertServiceWrapper"/>
<property name="jndiTemplate" ref="jndiTemplate"/>
</bean>
The application code is obtaining a reference to the AlertServiceEJB and makes a method call.
The problem we get is that we do not see the bean call being executed at all.
When we change the URL from the cluster address: t3://10.23.224.22,10.23.224.23:7007
to a url for a single server: t3://10.23.224.23:7007
the EJB call gets executed.
Does anyone have an idea what might be wrong?
Weblogic cluster URL not working
Does Weblogic expect to be using it's own InitialContext? Like isn't there a WLInitialContext or something that is maybe setup to parse that url differently?
t3://10.23.224.22:7007,10.23.224.23:7007
t3://10.23.224.22:7007,10.23.224.23:7007 will do
I tested this config, based on the weblogic example
file:///C:/Oracle/Middleware/wlserver_10.3/samples/server/examples/src/examples/spring/sconfig/instructions.html?skipReload=true
Client
<bean id="helloWorldService" class="org.springframework.remoting.rmi.JndiRmiPro xyFactoryBean">
<!--- niet EJB property name="jndiName" value="SimpleEJB#simple" /-->
<property name="jndiName" value="HelloService" />
<property name="serviceInterface" value="simple.SayHello" />
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WL InitialContextFactory</prop>
<prop key="java.naming.provider.url"> t3://localhost:8001,localhost:9001 </prop>
</props>
</property>
</bean>
Server
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean name="/sayHello" class="simple.SayHelloAction">
<property name="sayHello" ref="SimpleEJB#simple.SayHello"/>
<property name="transactionManager" ref="transactionManager"/>
</bean>
<bean id="myTestService" class="org.springframework.remoting.rmi.JndiRmiSer viceExporter">
<property name="service" ref="simpleSayHello"/>
<property name="serviceInterface" value="simple.SayHello1"/>
<property name="jndiName" value="HelloService"/>
</bean>
<bean id="simpleSayHello" class="simple.SimpleSayHello"/>
</beans>
Note that I had to remove
<property name="editMBeanServerConnection" ref="editMBeanServerConnection"/>
<property name="runtimeMBeanServerConnection" ref="runtimeMBeanServerConnection"/>