[JBoss Seam] - @Logger not injecting anything in Controller.class
by paradigmza
Hi,
I have a simple piece of code that is trying to persist/update the database
| VweraclientdnamesHome home = new VweraclientdnamesHome();
| home.setVweraclientdnamesId(input.getId());
| home.getInstance().setUsedForEras(true);
| home.update();
|
where home is a instance of the EntityHome class
When I run this code I get this null pointer
anonymous wrote :
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.framework.Controller.debug(Controller.java:183)
| at org.jboss.seam.framework.Home.updatedMessage(Home.java:40)
| at org.jboss.seam.framework.EntityHome.update(EntityHome.java:40)
| at coza.healthbridge.mypractice.admin.beans.session.EraClientDnamesBean.updateUsedForEras(EraClientDnamesBean.java:62)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
and stepping through a debug it looks like the @Logger is not injecting the object in Controller.class
Any ideas?
I used seam gen (1.2.1) to generate the project and the entities.
I then added another persistance unit to connect to another DB.
I can view all the CRUD pages for both PU's
I then just added this update code, and it is not working (I used seam 1.5 before this and the update code worked with seam gen)
Thanks
Sean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037553#4037553
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037553
19 years, 1 month
[EJB 3.0] - EJB 3.0 Locking (entity not in the persistence context)
by grdzeli_kaci
hi all,
i have some problems about locking,
i have 1 remote and one local interface
1. Remote Interface
| public @Stateful
| @Remote(RemoteInterface.class)
| class RemoteInterfaceBean implements RemoteInterface
| {
|
| @PersistenceContext(unitName = "CustomerCareOracle")
| private EntityManager oracleManager;
|
| public MySomeEntityObject object;
|
| @EJB
| MyLocalInterface inter;
|
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public void fillMyObject(someparameters .... )
| {
| // filling MySomeEntityObject object
| }
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public void commitMyObject()
| {
| inter.AnotherOperatOnObject(object);
| oracleManager.persist(object);
| }
| }
|
2. My Local Interface
| public @Stateless
| @Local(MyLocalInterface.class)
| class MyLocalInterfaceBean implements MyLocalInterface
| {
|
| @PersistenceContext(unitName = "CustomerCareOracle")
| private EntityManager oracleManager;
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public void AnotherOperatOnObject(MySomeEntityObject object)
| {
| oracleManager.lock(object,LockModeType.READ); // <= Here I Got An Error
| // do some operation and is succsess, It's very good ;)
| }
| }
|
|
when i tryed to lock object i got an error, i can't resolve this problem :(
can anybody help me ?
error trace
| 17:43:21,343 ERROR [errorCat] java.lang.IllegalArgumentException: entity not in the persistence context
| at org.hibernate.ejb.AbstractEntityManagerImpl.lock(AbstractEntityManagerImpl.java:336)
| at org.jboss.ejb3.entity.TransactionScopedEntityManager.lock(TransactionScopedEntityManager.java:101)
| at com.magti.businesslayer.ejb3Fasade.oracle.ccare.TransactionFasadeBean.lockAccounts(TransactionFasadeBean.java:203)
| at com.magti.businesslayer.ejb3Fasade.oracle.ccare.TransactionFasadeBean.doAfterCheck(TransactionFasadeBean.java:76)
| 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:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
|
|
Regards,
Paata.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037551#4037551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037551
19 years, 1 month
[JBoss Seam] - SQLException on jBPM Process Creation
by ajaneesh
Hi All,
I get the below error when i submit to an action method with the @CreateProcess annotation. What could be the reason. The error is very clear, a parent entry needs to be in the table jbpm_processinstance. The primary key in question is a auto generated one. (set up by jbpm). I manually created an entry in the processinstance table and ID_ was automatically generated. Dont understand what the problem could be, any help is appreciated.
I am using MySQL, SEAM 1.2.1-GA and Jboss 4.0.5-GA.
Caused by: java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails (`cvsportal/jbpm_moduleinstance`, CONSTRAINT `FK_MODINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance` (`ID_`))
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037549#4037549
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037549
19 years, 1 month
[Beginners Corner] - Developing web services
by pcankar
Hi,
I'm new to JBoss, trying to develop jax-ws web service. I have successfully written the same web service using java 6 embedded application server (just for testing).
When I?m trying to use method with complex type parameter I get the following error:
ERROR:
------
[SOAPFaultExceptionHelper] SOAP request exception
javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: javax.xml.bind.JAXBException: Failed to parse source: Requested element stevilo is not allowed in this position in the sequence. The next element should be {http://testws/jaws}stevilo
Method with String parameter is working OK.
Can anyone tell me what I?m doing wrong?
| WSDL:
| -----
| <definitions name='HelloBeanService' targetNamespace='http://testws/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://testws/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <schema elementFormDefault='qualified' targetNamespace='http://testws/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://testws/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <complexType name='SimpleObj'>
| <sequence>
| <element name='stevilo' type='int'/>
| <element name='tekst' nillable='true' type='string'/>
| </sequence>
| </complexType>
|
| </schema>
| </types>
| <message name='HelloBean_testResponse'>
| <part name='result' type='xsd:string'/>
| </message>
| <message name='HelloBean_test'>
| <part name='String_1' type='xsd:string'/>
| </message>
| <message name='HelloBean_simple'>
|
| <part name='SimpleObj_1' type='tns:SimpleObj'/>
| </message>
| <message name='HelloBean_simpleResponse'>
| <part name='result' type='tns:SimpleObj'/>
| </message>
| <portType name='HelloBean'>
| <operation name='simple' parameterOrder='SimpleObj_1'>
| <input message='tns:HelloBean_simple'/>
| <output message='tns:HelloBean_simpleResponse'/>
|
| </operation>
| <operation name='test' parameterOrder='String_1'>
| <input message='tns:HelloBean_test'/>
| <output message='tns:HelloBean_testResponse'/>
| </operation>
| </portType>
| <binding name='HelloBeanBinding' type='tns:HelloBean'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='simple'>
|
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://testws/jaws' use='literal'/>
| </input>
| <output>
| <soap:body namespace='http://testws/jaws' use='literal'/>
| </output>
| </operation>
| <operation name='test'>
|
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://testws/jaws' use='literal'/>
| </input>
| <output>
| <soap:body namespace='http://testws/jaws' use='literal'/>
| </output>
| </operation>
| </binding>
|
| <service name='HelloBeanService'>
| <port binding='tns:HelloBeanBinding' name='HelloBeanPort'>
| <soap:address location='http://pcankar:8080/wsprojectapp/HelloBean'/>
| </port>
| </service>
| </definitions>
|
|
|
| HelloBean.java
| --------------
| package testws;
| import testws.Hello;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| @Stateless
| @WebService()
| @SOAPBinding(style=SOAPBinding.Style.RPC,use=SOAPBinding.Use.LITERAL)
| public class HelloBean implements Hello {
| @WebMethod()
| public String test(String parameter){
| return "Hello world. You have called method test with parameter : " + parameter;
| }
| @WebMethod()
| public SimpleObj simple(SimpleObj vhod) {
| SimpleObj izhod = new SimpleObj();
| izhod.setStevilo(vhod.getStevilo());
| izhod.setTekst(vhod.getTekst());
| return izhod;
| }
| }
|
| Hello.java
| ----------
| package testws;
| import javax.ejb.Remote;
| @Remote
| public interface Hello {
| public String test(String parameter);
| public SimpleObj simple(SimpleObj vhod);
| }
|
|
| SimpleObj.java
| --------------
| package testws;
| public class SimpleObj {
| private String tekst="tekst";
| private int stevilo = 1;
| public int getStevilo() {
| return stevilo;
| }
| public void setStevilo(int stevilo) {
| this.stevilo = stevilo;
| }
| public String getTekst() {
| return tekst;
| }
| public void setTekst(String tekst) {
| this.tekst = tekst;
| }
| }
|
|
Used software:
-----------------
JBoss 4.0.4 (jboss-4.0.4.GA-Patch1-installer.jar),
java 5 (jdk-1_5_0_09-windows-i586-p.exe),
Eclipse (eclipse-SDK-3.1.2-win32.zip)
Best regards,
Peter
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037543#4037543
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037543
19 years, 1 month