Skip to Content
0
Former Member
Aug 28, 2012 at 05:22 AM

Job Scheduler in 7.3 - Facing issue 'does not have a connection factory name'

39 Views

Hi All,


I am getting error

Job "TestScheduler" of bean "TestScheduler" does not have a connection factory name. The connection factory name for jobs must be "JobQueueFactory".

Steps that I have followed are bit different from what is mentioned in document "SAP NW Scheduler for Java" pdf document of SAP; as I am working in 7.3

a) Created EJB Project

b) Created Message Driven Bean(JobSchedulerMDB.jav)

c) Created SchedulerJob(TestScheduler.java)


I dont see application-j2ee-engine.xml ; but have

ejb-j2ee-engine.xml

ejb-jar.xml

job-defination.xml

with following xml in them



ejb-j2ee-engine.xml

<?xml version="1.0" encoding="UTF-8"?>

<ejb-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ejb-j2ee-engine_3_0.xsd">

<enterprise-beans>


<enterprise-bean>

<ejb-name>JobSchedulerMDB</ejb-name>

<jndi-name>JobSchedulerMDB</jndi-name>

<bean-props>

<property>

<property-name>destination-name</property-name>

<property-value>JobQueue</property-value>

</property>

<property>

<property-name>connection-factory-name</property-name>

<property-value>JobQueueFactory</property-value>

</property>

</bean-props>

</enterprise-bean>

</enterprise-beans>

</ejb-j2ee-engine>


--------------------------------------------

ejb-jar.xml


<?xml version="1.0" encoding="UTF-8"?>

<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">

<display-name>

JobSchedulerEJBProject </display-name>

<ejb-client-jar>JobSchedulerEJBProjectClient.jar</ejb-client-jar>

</ejb-jar>



--------------------------------------------


job-defination.xml


<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<job-definitions>

<job-definition name="TestScheduler"/>

<enterprise-beans>

<enterprise-bean>

<ejb-name>JobSchedulerMDB</ejb-name>

<jndi-name>JobSchedulerMDB</jndi-name>

<resource-ref>

<res-ref-name>JobQueueFactory</res-ref-name>

</resource-ref>

<message-destination-ref>

<message-destination-ref-name>JobQueue</message-destination-ref-name>

<jndi-name>JobQueue</jndi-name>

</message-destination-ref>

</enterprise-bean>

</enterprise-beans>

</job-definitions>

--------------------------

TestScheduler.java

@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "JobDefinition=\'TestScheduler\' AND ApplicationName=\'sap.com/JobSchedulerEJBProjectEAR\'") })
public class TestScheduler extends MDBJobImplementation {

/**
* @see MDBJobImplementation#MDBJobImplementation()
*/
public TestScheduler() {
super();
// TODO Auto-generated constructor stub
}

@Override
public void onJob(JobContext jobContext) throws Exception {

Logger log = jobContext.getLogger();
log.info("Hello World!");
}

}

----------------------------

JobSchedulerMDB.java

@MessageDriven(
activationConfig = { @ActivationConfigProperty(
propertyName = "destinationType", propertyValue = "javax.jms.Queue"
) })
public class JobSchedulerMDB implements MessageListener {

/**
* Default constructor.
*/
public JobSchedulerMDB() {
// TODO Auto-generated constructor stub
}

/**
* @see MessageListener#onMessage(Message)
*/
public void onMessage(Message message) {
// TODO Auto-generated method stub

}

}


Please help me in this

Regards,

Ganga.