OSGI Declarative Service prints nothing - declarative-services

Dear talented programmers!
I have been working with OSGI framework and was trying to applied Declarative Service in my program, but it printed nothing on the screen.
My program is simple, just have one interface, one class implements it and one class consume the interface as the client.
- The Interface is:
package test.osdids.date;
public interface IDateService {
String getDate();
}
- The class implements Interface as the Service is:
package test.osdids.date.service;
import java.util.Calendar;
import test.osdids.date.IDateService;
public class DateService implements IDateService {
#Override
public String getDate() {
String date = Calendar.getInstance().getTime().toString();
return date;
}
}
The XML to registered the service is:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
name="test.osdids.date.service">
<implementation class="test.osdids.date.service.DateService" />
<service>
<provide interface="test.osdids.date.IDateService" />
</service>
</scr:component>
The Manifest file of the service is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TESTOSDIDSDATESERVICE
Bundle-SymbolicName: TESTOSDIDSDATESERVICE
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Service-Component: OSGI-INF/DateBridge.xml
Export-Package: test.osdids.date
Bundle-ActivationPolicy: lazy
- And now, this is the class which will consume the service as the client and prints out the result ( This class was located in other plug-in project, different from the former plug-in project which stored the interface and the implementation class above):
package test.osdids.date.consumer;
import test.osdids.date.IDateService;
public class DateConsumer {
private IDateService dateService;
public synchronized void setService(IDateService dateService) {
this.dateService = dateService;
System.out
.println("The Date Service has been registered successfully!");
System.out.println("The current time is: " + dateService.getDate());
}
public synchronized void unsetService(IDateService dateService) {
System.out
.println("The Date Service has been unregistered successfully!");
}
public void activate() {
System.out.println("Test again...");
System.out.println("The current time is: " + dateService.getDate());
}
public void deactivate() {
System.out.println("Stop the service!");
}
}
- This is the XML file to consume and bind the service of consumer class:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
name="test.osdids.date.consumer" activate="activate"
deactivate="deactivate" enabled="true" immediate="true">
<implementation class="test.osdids.date.consumer.DateConsumer" />
<reference bind="setService" cardinality="1..1"
interface="test.osdids.date.IDateService" name="IDateService" policy="static"
unbind="unsetService" />
</scr:component>
- This is the manifest file:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TESTOSDIDSDATECONSUMER
Bundle-SymbolicName: TESTOSDIDSDATECONSUMER
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: TESTOSDIDSDATESERVICE;bundle-version="1.0.0"
Service-Component: OSGI-INF/DateBridgeConsumer.xml
Import-Package: test.osdids.date
Bundle-ActivationPolicy: lazy
- And here is the result on the screen:
osgi>
(Nothing happened)
But when I use jUnit test to test the method activate() in class DateConsumer, it worked. However, when I tried to run the plug-in project by OSGI framework, nothing happened.
I hope that someone who knows this problem and help me.
Thanks a lot in advance!

I got the answer, just launch the bundle consumer by Eclipse framework (product), not by OSGI framework, then the bundles will work smoothly

Related

How to declare a element for complex data type defined in a xsd file located in jar file

I have a below xsd file in a jar dependency file in a Spring boot project. The xsd does not declare the element declaration, which is required by spring boot validation. So I am trying to add another xsd in my project resource folder to declare element type.
XSD in Jar file: /wsdl/xsd/UserService-v1-0.xsd
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema targetNamespace="http://usermanagement.com/userservice/xsd/2014/07"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:userservice="http://usermanagement.com/userservice/xsd/2014/07"
elementFormDefault="qualified">
<xsd:import namespace="http://usermanagement.com/userservice/common/xsd/2014/09" schemaLocation="userserviceCommon-v1-0.xsd"/>
<xsd:import namespace="http://usermanagement.com/userserviceabsolute/common/xsd/2014/09" schemaLocation="userserviceAbsoluteCommon-v1-0.xsd"/>
<xsd:complexType name="GetUsersRequest">
<xsd:attribute name="language" type="xsd:language" use="optional" default="en" />
</xsd:complexType>
</xsd:schema>
Please note that I tried to keep the complex type simple by removing some of the elements for this post. The location of file is /wsdl/xsd.
XSD to declare the element in the main Project resource: /wsdl/xsd/UserService-type-v1-0.xsd
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema targetNamespace="http://usermanagement.com/userservice/wsdl/userserviceService-v1-0"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:userservice="http://usermanagement.com/userservice/xsd/2014/07"
elementFormDefault="qualified">
<import namespace="http://usermanagement.com/userservice/xsd/2014/07" schemaLocation="jar:file://{path to the jar}/!/wsdl/xsd/userserviceService-v1-0.xsd"/>
<element name="GetUsersRequest" type="userservice:GetUsersRequest"/>
</xsd:schema>
As per my understanding we need to refer to the schemaLocation of xsd file in jar using notation "jar:file://{path to the jar}/!/wsdl/xsd/userserviceService-v1-0.xsd".
However I am not sure how to declare the path to the jar. Also not sure if this is the only way to refer to the definitions in the xsd in the jar files. In the above approach when ever a new version of jar is released we need to update the xsd file.
Also including the Spring WS schema validation config:
#Configuration
public class MyWsValidatorConfig extends WsConfigurerAdapter {
#Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
PayloadValidatingInterceptor validatingInterceptor = new PayloadValidatingInterceptor();
validatingInterceptor.setValidateRequest(true);
validatingInterceptor.setValidateResponse(true);
validatingInterceptor.setXsdSchemaCollection(new XsdSchemaCollection() {
#Override
public XsdSchema[] getXsdSchemas() {
return null;
}
#Override
public XmlValidator createValidator() {
try {
return XmlValidatorFactory.createValidator(getSchemas(), "http://www.w3.org/2001/XMLSchema");
} catch (Exception e) {
log.error("Failed to create validator e={}", e);
}
return null;
}
public Resource[] getSchemas() {
List<Resource> schemaResources = new ArrayList<>();
schemaResources.add(new ClassPathResource("/wsdl/xsd/UserService-v1-0.xsd"));
schemaResources.add(new ClassPathResource("/wsdl/xsd/UserService-type-v1-0.xsd"));
return schemaResources.toArray(new Resource[schemaResources.size()]);
}
});
interceptors.add(validatingInterceptor);
}
}
This is the first time I am working with XSD and SOAP web services. Able to cross other hurdles but got stuck with this issue.
Please help.

java.lang.NoClassDefFoundError: org/springframework/messaging/converter/MessageConverter

I am new to Spring Integration . I am not using maven and my integration-spring.xml is located inside src/resources/integration-spring.xml and all my jars are having v4.0.5+. I am getting below exception when running my JUnit Test case.
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [resources/integration-spring.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/messaging/converter/MessageConverter
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
integration-spring.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
<int:gateway service-interface="com.fil.MyService" id="myGateway"
default-request-channel="in" />
<int:service-activator input-channel="in" method="someMethod"
ref="exampleHandler" />
<bean id="exampleHandler" class="com.fil.MyServiceImpl" />
Test.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import com.fil.MyService;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(locations = { "/resources/integration-spring.xml" })
public class MyServiceTest {
#Autowired
private MyService service;
#Test
public void test() {
try{
service.single("hELLO ");
}
catch(Exception e){
e.printStackTrace();
}
}
}
This problem may occur, when you use not compatible spring boot and spring libraries too.
I my case I had to to update spring boot to current version.
You really should use maven or gradle to manage your project's dependencies; doing it manually is just too painful - especially with regard to getting all the versions right.
NoClassDefFoundError: org/springframework/messaging/converter/MessageConverter
The org.springframework.messaging package is provided by the spring-messaging jar file from the core Spring Framework. It contains general messaging abstractions used by Spring Integration (and other Spring projects).
Since you are "new" to the framework(s), you really should be using the latest versions:
org.springframework.integration:spring-integration-core:4.3.9.RELEASE
which depends on
org.springframework:spring-messaging:4.3.8.RELEASE
by default.
v4.0.5+
You must make sure that all jars from the same project (Spring Integration or Spring Framework) have their same respective versions (spring-beans, spring-messaging, etc must match and spring-integration-* must all be the same version).

issues when using spring aop load-time weaving deal with methods call inside itself

I have bussiness class as follow:
class A {
public void sayHello(String name){
System.out.println("hello "+name);
}
public void openDoorForJack(){
System.out.println("door opened");
this.sayHello("Jack");
}
}
and aspect class as follow:
#Aspect
class Aspect {
#Pointcut("execution (* com..*.sayHello(String)) && args(name)")
public void beforeSayHelloPointCut(String name) {}
#Before("beforeSayHelloPointCut(name)")
public void beforeSayHello(String name) throws Throwable {
System.out.println(name+" is knocking");
}
}
after I have all those beans configured in spring,I turn LTW on using
<aop:aspectj-autoproxy/>
<context:load-time-weaver aspectj-weaving="on" weaver-class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
of course aspectjrt,aspectj-weaver,spring-instrument are in position,-javaagent:path/spring-instrument.jar is passed to VM options and follow aop.xml is under META-INF
<!DOCTYPE aspectj PUBLIC
"-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
<weaver>
<!-- only weave classes in specific packages -->
<include within="*"/>
</weaver>
<aspects>
<!-- weave in just this aspect -->
<aspect name="com.Aspect"/>
</aspects>
</aspectj>
When I run test like:
applicationContext.getBean(A.class).sayHello("Jack");
result seems perfect
Jack is knocking
Hello Jack
But when I run test that call sayHello inside itself
applicationContext.getBean(A.class).openDoorForJack();
no interception happens at all
door opened
Hello Jack
The reason way I use LTW is that I want methods call using "this" or "super" can be intercepted as well,but seems I failed to do so.
Would someone help me point out the problem,is there something I missed?
----------------------------EDIT---------------------------------
After some debug I found where I got wrong
In real life,
I hava "class A" under package com.bussiness
and "class Aspect" under package com.aspect
I worte aop.xml like follow
<weaver>
<!-- only weave classes in specific packages -->
<include within="com.aspect.*"/>
</weaver>
which is not correct,it should be the package that contains classes need to be woven,after I changed it to
<weaver>
<!-- com package and its sub package all get woven-->
<include within="com..*"/>
</weaver>
It finally work
Try dynamic proxy, it should work. It's not easy but I think this is what you need.
More on this:
How to use AOP to intercept a method call in super on an argument?

IDempiere Service Integration

I need to call Idempiere Business Modules (ex. Creating Purchase Order process) , not tables via a web services, Is there any way to do this without going through the source code of Idempiere, I don't want to use RESTful methods that will deal with tables directly
You are probably referring to improvements on iDempiere's Web Services where composite (master-detail) and CRUD actions are now possible. Complete description at the project wiki: http://wiki.idempiere.org/en/NF1.0_Web_Services_Improvements
Below I paste results of https://test.idempiere.org/ADInterface/services
Available SOAP services:
CompositeService
compositeOperation
Endpoint address: http://test.idempiere.org/ADInterface/services/compositeInterface
WSDL : {http://idempiere.org/ADInterface/1_0}compositeInterface
Target namespace: http://idempiere.org/ADInterface/1_0
ModelADService
setDocAction
createUpdateData
getList
readData
createData
runProcess
queryData
deleteData
updateData
Endpoint address: http://test.idempiere.org/ADInterface/services/ModelADService
WSDL : {http://idempiere.org/ADInterface/1_0}ModelADService
Target namespace: http://idempiere.org/ADInterface/1_0
Available RESTful services:
Endpoint address: http://test.idempiere.org/ADInterface/services/rest
WADL : http://test.idempiere.org/ADInterface/services/rest?_wadl
You can use create a provide service interface from org.adempiere.base plugin, invoke this service inside your code and invoke the constructor for class MOrder extends X_C_Order and for class MOrderLine extends X_C_OrderLine.
Here you have the example from IProcessFactory (you can create your factory like ICreateOrderFactory , or just IInsertFactory ( for a generic factory constructor you can set the table id ) :
This is a interface declaration
public interface IProcessFactory {
/**
* Create new process instance
* #param className
* #return new process instance
*/
public ProcessCall newProcessInstance(String className);
}
This is a evocation method
public class ProcessFactory implements IProcessFactory {
#Override
public ProcessCall newProcessInstance(String className) {
if (className.equals("com.com.nexus.webservice.client.process.IntegratorWS"))
return new IntegratorWS();
else
return null;
}
}
Now you need to create .xml of this factory like that : (pay attention in provided interface)
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="com.nexus.integrator.ProcessFactory">
<implementation class="com.nexus.webservice.client.process.ProcessFactory"/>
<property name="service.ranking" type="Integer" value="5"/>
<service>
<provide interface="org.adempiere.base.IProcessFactory"/>
</service>
</scr:component>
To use this in OSGI architecture, you need to configure your MANIFEST file to import this
Service-Component: ( I always use osgi-inf directory for my factories xml)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.nexus.webservice.client
Bundle-SymbolicName: com.nexus.webservice.client;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Macrosoftware
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.adempiere.base
Service-Component: OSGI-INF/ProcessFactory.xml
Import-Package: org.osgi.framework
You can do this , or you can use composite webservice .
I consider the second most safe and effective method

How to map commonj.work.WorkManager with weblogic 10.3 Work Manager

I am trying to use WorkManagers in Weblogic 10.3. I have defined work managers in weblogic-ejb-jar.xml. I declared a resource reference for commonj.work.WorkManager in ejb-jar.xml with the res-ref-name same as the Work manager defined in weblogic-ejb-jar.xml. Here I am posting the code
MDB
package test;
import javax.annotation.Resource;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.jms.TextMessage;
import commonj.work.WorkManager;
#MessageDriven(mappedName="TEST_Q", name="MDBWithWorkManager", activationConfig = {
#javax.ejb.ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
#javax.ejb.ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
#javax.ejb.ActivationConfigProperty(propertyName = "transactionType", propertyValue = "Container")
})
public class MDBWithWorkManager implements MessageListener {
#Resource(mappedName="TestWorkManager")
private WorkManager workManager;
#Override
public void onMessage(Message arg0) {
System.out.println("onMessage() called ");
System.out.println("workManager : "+workManager);
if(arg0 instanceof TextMessage){
TextMessage msg= (TextMessage)arg0;
try {
System.out.println("Message received-->"+msg.getText());
} catch (JMSException e) {
e.printStackTrace();
}
}
}
}
ejb-jar.xml
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
version="3.0">
<enterprise-beans>
<message-driven>
<ejb-name>MDBWithWorkManager</ejb-name>
<ejb-class>test.MDBWithWorkManager
</ejb-class>
<resource-ref>
<description>Test work manager</description>
<res-ref-name>TestWorkManager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
weblogic-ejb-jar.xml
<?xml version = '1.0'?>
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>MDBWithWorkManager</ejb-name>
</weblogic-enterprise-bean>
<work-manager>
<name>TestWorkManager</name>
<fair-share-request-class>
<name>TestWorkShare</name>
<fair-share>70</fair-share>
</fair-share-request-class>
<min-threads-constraint>
<name>TestMinThread</name>
<count>1</count>
</min-threads-constraint>
<max-threads-constraint>
<name>TestMaxThread</name>
<count>8</count>
</max-threads-constraint>
</work-manager>
</weblogic-ejb-jar>
Getting the following error while deploying
Unable to deploy EJB: MDBWithWorkManager from MDBWithWorkManager.jar:
[EJB:011026]The EJB container failed while creating the java:/comp/env namespace for this EJB deployment.
weblogic.deployment.EnvironmentException: [EJB:010176]The resource-env- ref 'test.MDBWithWorkManager/workManager' declared in the ejb-jar.xml descriptor or an
notation has no JNDI name mapped to it. The resource-ref must be mapped to a JNDI name using the resource-description element of the weblogic-ejb-jar.xml des
criptor or corresponding annotation.
at weblogic.ejb.container.deployer.EnvironmentBuilder.addResourceEnvReferences (EnvironmentBuilder.java:639)
at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentContext (EJBDeployer.java:247)
at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentFor(EJBDeployer.java:1014)
at weblogic.ejb.container.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:908)
at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1188)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:425)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Can any one please help out.
Thanks in Advance!!!!
Try adding res-ref to the actual jndi name mapping in weblogic-ejb-jar.xml for MDBWithWorkManager
something like this,
<resource-description>
<res-ref-name>TestWorkManager</res-ref-name>
<jndi-name>jndiNameOfTestWorkManager</jndi-name>
</resource-description>
believe what you need is to define a "map"-element called <dispatch-policy> within your bean def - like:
<weblogic-enterprise-bean>
<ejb-name>MDBWithWorkManager</ejb-name>
</weblogic-enterprise-bean>
change it to:
<weblogic-enterprise-bean>
<ejb-name>MDBWithWorkManager</ejb-name>
<dispatch-policy>TestWorkManager</dispatch-policy>
</weblogic-enterprise-bean>

Resources