[JBoss jBPM] - Re: JBPM3 with tomcat
by mattlc
Hello,
I'm a very yong jbpm child and I need help...
I spent all this day on this topic and I finally passed the connection test before deploying my process on the jbpm server.
I used the war file method to deploy the jbpm server on tomcat and by making some configuration changes and by adding "some" jars, It finally worked.
Now the problem is that I can't deploy the process on this jbpm "server" on tomcat.
No error in the console and nothing appends appart from the window which tells me the deployment failed...blablabla...
Here is my question :
Were does the error come from ?
[list=]form the jbpm server (bad deployment...)
from the "new jbpm project" process file
from my empty MySQL database ?
Is there a specific method for deploying a process on jbpm when it not on the jboss test server (start.bat & stop.bat)?
tks a lot for replying!!
matt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969778#3969778
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969778
19 years, 7 months
[JBossWS] - java.sql.SQLException: Already closed
by peiguo
In my web service, I need to access Oracle database, so I created the oracle-ds.xml file in my deploy directory like this:
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>hhsDB</jndi-name>
<connection-url>jdbc:oracle:thin:@aadv1db.abcd.com:1521:aadv1</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>sim</user-name>
sim
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<type-mapping>Oracle10g</type-mapping>
</local-tx-datasource>
And in my code I have this function to get connection for me:
private Connection getConnection() throws Exception {
InitialContext initialContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) initialContext.lookup("java:hhsDB");
java.sql.Connection conn = ds.getConnection();
return conn;
}
But it keeps giving me "java.sql.SQLException: Already closed", even after I removed those .close() calls from my code... What should I do?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969773#3969773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969773
19 years, 7 months
[EJB 3.0] - EJB3 PersistanceManager confusion
by jrosskopf
Hello List,
I try to do my first steps with EJB3 and set up a small example persisting a detatched pojo entity (which is generated in a client) through a stateless session bean.
I´ll attach the code of the three components at the end of the message.
When I invoke the the method, that should persist the entity I get the following exception:
| Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.toolsforjobs.j2ee.test.server.domain.Debtor
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:225)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
|
But that is exactly what I´m wanting: Saving a detached entry ;-)
What I´m doing wrong?
Regards
---
Joachim
The Entity Bean
| package com.toolsforjobs.j2ee.test.server.domain;
|
| import java.io.Serializable;
|
| import javax.persistence.CascadeType;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.OneToOne;
| import javax.persistence.Transient;
|
| @Entity
| public class Debtor implements Serializable{
| @Transient
| private static final long serialVersionUID = 3154162344396113561L;
|
| int id;
| String idAtCustomer;
| double balance;
|
| //Address address;
|
| /*
| @OneToOne(cascade={CascadeType.ALL})
| public Address getAddress() {
| return address;
| }
| */
| public double getBalance() {
| return balance;
| }
|
| @Id @GeneratedValue
| public int getId() {
| return id;
| }
|
| public String getIdAtCustomer() {
| return idAtCustomer;
| }
| /*
| public void setAddress(Address address) {
| this.address = address;
| }
| */
| public void setBalance(double balance) {
| this.balance = balance;
| }
|
| public void setId(int id) {
| this.id = id;
| }
|
| public void setIdAtCustomer(String idAtCustomer) {
| this.idAtCustomer = idAtCustomer;
| }
| }
|
The Stateless Session Bean
| package com.toolsforjobs.j2ee.test.server;
|
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import com.toolsforjobs.j2ee.test.server.domain.Debtor;
|
| @Stateless
| public class DebtorAgentBean implements DebtorAgentRemote {
|
| @PersistenceContext(unitName="tfj-dbs") EntityManager manager;
|
| public Debtor findDebtor(int id) {
| return manager.find(Debtor.class, id);
| }
|
| public void saveDebtor(Debtor deb) {
| manager.persist(deb);
| }
|
| }
|
And the calling client
| package com.toolsforjobs.j2ee.test.client;
|
| import javax.naming.Context;
| import javax.rmi.PortableRemoteObject;
|
| import com.toolsforjobs.j2ee.test.server.DebtorAgentRemote;
| import com.toolsforjobs.j2ee.test.server.domain.Address;
| import com.toolsforjobs.j2ee.test.server.domain.Debtor;
|
| public class DebtorClient {
| public static void main(String[] args) {
| try {
| Context jndiContext = getInitialContext();
| Object ref = jndiContext.lookup("DebtorAgentBean/remote");
| DebtorAgentRemote dao = (DebtorAgentRemote) PortableRemoteObject.narrow(ref, DebtorAgentRemote.class);
|
| Debtor deb1 = new Debtor();
| deb1.setId(1);
| deb1.setBalance(100.0d);
| deb1.setIdAtCustomer("toolsforjobs");
|
| dao.saveDebtor(deb1);
| } catch (javax.naming.NamingException ne) {
| ne.printStackTrace();
| }
| }
|
| public static Context getInitialContext() throws javax.naming.NamingException {
| return new javax.naming.InitialContext();
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969771#3969771
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969771
19 years, 7 months
[JBossCache] - Performence
by lior.dra
Hi
I have been trying to use JbossCache 1.4 SP1, as a caching solution,
However I encounter performence issues,
I have not been able to write more then 1000 updates per sec, on a single node, and I need a solution able to write as many as 15,000 per sec.
I have been written a small test to demonstrate:
I have been using MR. Ben Wang's Address and Student classes, along with
../etc/META-INF/replSync-service.xml
I have compiled the classes with the aopc compiler.
the jboss-aop.xml file I am using is the one under the .../examples/PojoCache/ ....... .
Test setup 2 nodes:
Machine 1:
JVM 1.5.07
Fedora 5 linux.
1GM memory
Machine 2
JVM 1.5.07
Solaris 10 2GM memory
Use Case 1:
When I run this code unclustered I can update 12,000 times per second
Use Case 2:
When I run this code in a 2 node cluster the performence drops to something like 900 - 1200 updates per second.
Use Case 3:
When I run this code with the 's' param, one one node, meaning I have just one writer node, I get the same results: 900 - 1200 updates per second.
I have noticed that the CPU usage rises to 80 - 100 % even when the node is not writing / reading the cache.
What am I doing wring ?
is this the kind of performence I can expect?
According to the following link
http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatShouldWeExpectOfThePojoCache... I should be just fine, but the results I am getting is very far from it, whay is that ?
Thanks
Lior
my class is:
package com.protagonis.cache;
//import org.jboss.cache.Fqn;
//import org.jboss.cache.PropertyConfigurator;
//mport org.jboss.cache.aop.PojoCache;
import java.util.*;
import javax.naming.*;
import javax.transaction.*;
import org.jboss.cache.*;
import org.jboss.cache.aop.*;
import com.protagonis.test.utils.*;
public class ManualTestCacheJbossExample {
private static final String base_dir = "./etc/resources/configuration/";
private PojoCache tree;
public static void main(String[] argv) throws Exception {
ManualTestCacheJbossExample ct = new ManualTestCacheJbossExample();
ct.tree = ct.StartCache();
if (argv.length > 1)
if (argv[1].equals("s")) {
while (true) {
Thread.sleep(0, 10);
}
}
/*
* Timing.assertElapseTime(ct, "doAspect", new Object[] { new Integer(
* argv[0]).intValue(), }, 100000L);
*/
ct.doAspect(new Integer(argv[0]).intValue());
ct.tree.stop();
}
public ManualTestCacheJbossExample() {
}
public void doAspect(int howMany) {
try {
Student st1 = new Student();
st1.setSchool("school1");
st1.setName("Name1");
Address adr = new Address();
adr.setCity("city");
adr.setStreet("str");
adr.setZip(1);
st1.setAddress(adr);
Fqn fqn = Fqn.fromString("a/b");
int count = 1;
while (count < howMany) {
try {
Student std2 = (Student) tree.getObject(fqn);
if (std2 == null) {
tree.putObject(fqn, st1);
continue;
}
Address adr2 = std2.getAddress();
adr.setZip(adr.getZip() + 1);
if (count % 1000 == 0)
System.out
.println(" Count " + count + " Zip "
+ adr2.getZip() + 1 + " Name "
+ std2.getName());
} catch (Exception e) {
e.printStackTrace();
}
count++;
}
} catch (Exception e) {
e.printStackTrace();
}
}
public PojoCache StartCache() {
try {
InitJvm.init();
tree = new PojoCache();
PropertyConfigurator config = new PropertyConfigurator(); // configure
config.configure(tree, base_dir + "replSync-service.xml");
tree.setClusterName("Sample-Cluster");
tree.start(); // kick start the cache
Thread.sleep(5000);
return tree;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969769#3969769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969769
19 years, 7 months