[Beginner's Corner] - javax.naming.NameNotFoundException: jdbc not bound
by Smitha K
Smitha K [https://community.jboss.org/people/smithakutty] created the discussion
"javax.naming.NameNotFoundException: jdbc not bound"
To view the discussion, visit: https://community.jboss.org/message/780560#780560
--------------------------------------------------------------
I have the following deployment details:-( I am trying to connect to the database,but getting error)
1)ejb-jar.xml:-
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
" http://java.sun.com/dtd/ejb-jar_2_0.dtd http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>A simple session bean</description>
<display-name>Simple Message EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>FirstEJBBean</ejb-name>
<home>FirstEJBHome</home>
<remote>FirstEJBObject</remote>
<local-home>FirstLocalEJBHome</local-home>
<local>FirstLocalEJBObject</local>
<ejb-class>FirstEJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description> Maximum percentage discount for a customer </description>
<env-entry-name> maxCustomerDiscount </env-entry-name>
<env-entry-type> java.lang.Double </env-entry-type>
<env-entry-value> 50 </env-entry-value>
</env-entry>
<ejb-ref>
<ejb-ref-name>ejb/FirstEJBBeanRemoteTest</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>FirstEJBHome</home>
<remote>FirstEJBObject</remote>
<ejb-link>FirstEJBBean</ejb-link>
</ejb-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/FirstEJBBeanTest</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>FirstLocalEJBHome</local-home>
<local>FirstLocalEJBObject</local>
<ejb-link>FirstEJBBean</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jdbc/nbuDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
2)jboss-xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>FirstEJBBean</ejb-name>
<resource-ref>
<res-ref-name>jdbc/nbuDS</res-ref-name>
<jndi-name>jbossDS</jndi-name>
</resource-ref>
<jndi-name>ejb/FirstEJBBeanRemote</jndi-name>
</session>
</enterprise-beans>
</jboss>
My Local bean code is:-
ejbCtx = (Context) context.lookup("java:comp/env");
dsrc = (DataSource)ejbCtx.lookup("jdbc/nbuDS");
I have jboss-ds file in the default/deply folder configured as follows:-
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jbossDS</jndi-name>
<connection-url>jdbc:sqlserver://172.16.84.66:1433;sendStringParametersAsUnicode=false;databaseName=NBU</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<min-pool-size>5</min-pool-size>
<max-pool-size>30</max-pool-size>
<track-statements>true</track-statements>
<prepared-statement-cache-size>10</prepared-statement-cache-size>
<query-timeout>60</query-timeout>
<user-name>sa</user-name>
<password>M8$tek12</password>
</local-tx-datasource>
</datasources>
But i am still unable to connect to database.
Please provide me inputs for the same.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/780560#780560]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months
[jBPM] - Error while starting the process
by VinothKumar Srinivasan
VinothKumar Srinivasan [https://community.jboss.org/people/svinothmca] created the discussion
"Error while starting the process"
To view the discussion, visit: https://community.jboss.org/message/784815#784815
--------------------------------------------------------------
I am facing the following errors when i start the process
Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at org.jbpm.test.JBPMHelper.loadStatefulKnowledgeSession(JBPMHelper.java:147)
at org.jbpm.test.JBPMHelper.newStatefulKnowledgeSession(JBPMHelper.java:136)
at com.sample.ProcessMain.main(ProcessMain.java:20)
Caused by: org.hibernate.HibernateException: Could not obtain BTM transaction manager instance
at org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:367)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
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:597)
at org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)
... 9 more
Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal
at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:75)
at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62)
... 14 more
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at java.io.RandomAccessFile.read(Native Method)
at java.io.RandomAccessFile.readInt(RandomAccessFile.java:720)
at bitronix.tm.journal.TransactionLogHeader.<init>(TransactionLogHeader.java:96)
at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:69)
at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:151)
at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:62)
... 15 more
The source code for this process is
*Processmain.java ---*
package com.sample;
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.jbpm.test.JBPMHelper;
/**
* This is a sample file to launch a process.
*/
public class ProcessMain {
public static final void main(String[] args) throws Exception {
startUp();
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);
// start a new process instance
ksession.startProcess("com.sample.bpmn.hello");
System.out.println("Process started ...");
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
private static void startUp() {
JBPMHelper.startH2Server();
JBPMHelper.setupDataSource();
// please comment this line if you already have the task service running,
// for example when running the jbpm-installer
//JBPMHelper.startTaskService();
}
}
*ProcessTest.java -------*
package com.sample;
import java.util.List;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.process.ProcessInstance;
import org.jbpm.task.TaskService;
import org.jbpm.task.query.TaskSummary;
import org.jbpm.test.JbpmJUnitTestCase;
import org.junit.Test;
/**
* This is a sample file to launch a process.
*/
public class ProcessTest extends JbpmJUnitTestCase {
public ProcessTest() {
super(true);
setPersistence(true);
}
@Test
public void testProcess() {
StatefulKnowledgeSession ksession = createKnowledgeSession("sample.bpmn");
TaskService taskService = getTaskService(ksession);
ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");
assertProcessInstanceActive(processInstance.getId(), ksession);
assertNodeTriggered(processInstance.getId(), "Start", "Task 1");
// let john execute Task 1
List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
TaskSummary task = list.get(0);
System.out.println("John is executing task " + task.getName());
taskService.start(task.getId(), "john");
taskService.complete(task.getId(), "john", null);
assertNodeTriggered(processInstance.getId(), "Task 2");
// let mary execute Task 2
list = taskService.getTasksAssignedAsPotentialOwner("mary", "en-UK");
task = list.get(0);
System.out.println("Mary is executing task " + task.getName());
taskService.start(task.getId(), "mary");
taskService.complete(task.getId(), "mary", null);
assertNodeTriggered(processInstance.getId(), "End");
assertProcessInstanceCompleted(processInstance.getId(), ksession);
ksession.dispose();
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/784815#784815]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months
[jBPM] - !!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
by mdskjfdfjglk jdlkjlgkj
mdskjfdfjglk jdlkjlgkj [https://community.jboss.org/people/fghjkljg] created the discussion
"!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe"
To view the discussion, visit: https://community.jboss.org/message/784783#784783
--------------------------------------------------------------
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
;
;
;;
GO>>>>> http://dmmp2p.eu/tv4.html
'
'
'
''
'
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
;
;
;;
GO>>>>> http://dmmp2p.eu/tv4.html
'
'
'
''
'
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
;
;
;;
GO>>>>> http://dmmp2p.eu/tv4.html
'
'
'
''
'
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
;
;
;;
GO>>>>> http://dmmp2p.eu/tv4.html
'
'
'
''
'
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
!!w@TcH!! New York Giants vs Baltimore Ravens Live FrEe
;
;
;;
GO>>>>> http://dmmp2p.eu/tv4.html
'
'
'
''
'
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/784783#784783]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months