[EJB 3.0] - problems with @Idclass
by lastra
well i will explain a bit, i have one table with 3 fields how primary key, i'm using @Idclass and when i'm using any function of .find i get that exception:
javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [com.recargaexpress.gestionpro.entity.Apuntes#component[empresa,numeroAsiento, numeroLinea]{numeroLinea=1,numeroAsiento=86, empresa=1}]
My entity:
@Entity
@Table(name="APUNTES")
@IdClass(ApuntesPK.class)
public class Apuntes implements Serializable{
//Claves
@Id
@Column(name="EMPRESA")
private Integer empresa;
@Id
@Column(name="NUMERO_ASIENTO")
private Integer numeroAsiento;
@Id
@Column(name="NUMERO_LINEA")
private Integer numeroLinea;
private String modificado;
.......
others fields and methods get/set
}
and in other class file:
public class ApuntesPK implements Serializable {
private Integer empresa;
private Integer numeroLinea;
private Integer numeroAsiento;
//private static final long serialVersionUID = 1L;
public ApuntesPK() {
}
public ApuntesPK(int empresa, int numAsiento, int numLinea){
this.empresa=empresa;
this.numeroLinea=numLinea;
this.numeroAsiento=numAsiento;
}
......
Methods get/set
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
else if (o instanceof ApuntesPK ) {
return empresa==(((ApuntesPK)o).empresa) &&
numeroAsiento==(((ApuntesPK)o).numeroAsiento)&& numeroLinea==(((ApuntesPK)o).numeroLinea);
}
return false;
}
@Override
public int hashCode() {
return this.numeroLinea ^ this.numeroAsiento ^ this.empresa;
}
}
In my bean method for find:
public Apuntes buscarApunte(int empresa, int numAsiento, int numLinea) throws RemoteException {
ApuntesPK pk = new ApuntesPK();
pk.setEmpresa(empresa);
pk.setNumeroAsiento(numAsiento);
pk.setNumeroLinea(numLinea)
Apuntes sqlb= em.find(Apuntes.class, pk);
return sqlb;
}
And in request from my client:
Apuntes x= beanremote.buscarApunte(1,86,1);
If anyone can help me, and sry for my english
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144306#4144306
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144306
18 years, 3 months
[JBoss jBPM] - Problem in deploying processdefinition in a war file
by syedtaj
Hi,
I have a war file, which has a servlet that will load on startup to deploy my process definitions like the following -
| pdSubProcess = processDefinition.parseXmlResource("AutomationService/processdefinition.xml");
| jbpmContext.deployProcessDefinition(pdSubProcess);
I get a java.net.MalformedURLException, cause the class loader is not able to find the process definition, which is strange because it is in the classes folder in WEB-INF
automation.war\WEB-INF\classes\AutomationService\processdefinition.
I saw the JBOSS code that loads the resource files, it uses the ClassLoader to deploy the resource. I mimicked that code like this
ClassLoader automationServiceLoader = AutomationServiceServlet.class.getClassLoader();
| InputStream inputStream = automationServiceLoader.getResourceAsStream("AutomationService/processdefinition.xml");
| pdSuperProcess = ProcessDefinition.parseXmlInputStream(inputStream);
|
The above code works, but created a new problem. I also wonder why didn't ProcessDefinition.parseXmlResource work because internally it does the same thing, using its own class - ClassLoaderUtil.class.getClassLoader()
I am stumped.
Now the second problem, after making the above work and once all the process definitions are deployed, the action classes that they refer to from the process definitions are not visible to class loader, and I get a ClassNotFoundException. I tried making a jar file and placing it in the WEB-INF\lib folder as well, with no success. I guess thats because I am using a different class loader to load the process definitions, the class folder in WEB-INF or the lib folders are not visible to it.
Thus how do I actually make this work, how do I deploy the processdefinitions along with its related class files.
Any help would be appreciated. Stuck from some time on this one.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144292#4144292
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144292
18 years, 3 months
[JBoss Messaging] - Re: Clustered server preference
by clebert.suconic@jboss.com
JCA is to be used internally on the application server.
If you have external clients, why do you need the JCA adapter, why you can't just use ClusteredXAConnectionFactory from the client side?
anonymous wrote : java.naming.provider.url=jnp://devapp2.qa.cin.int:1100,jnp://devapp1.qa.cin.int:1100
|
I'm not sure what this is doing.. please ask it on the JCA forum or look for some documentation.
But I believe you messing up with the JCA's load balance and the JBossMessaging load balancing. i.e. you are making up a big mess.
The ClsuteredXAConnectionFactory already has a load balancing, and you are putting another load balancing in top of that on this new JCA adapter you're creating.
Usually, we prefer to have MDBs aways connecting to the local queue (there is no point on doing a cluster round trip if there is a consumer available on the current node), and then relay on message redistribution if a server is too busy.
You should clear up this!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144275#4144275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144275
18 years, 3 months