[jboss-user] [EJB 3.0] - Problems setting timer to entity bean

2008-08-27 Thread jaki
Hi, 
Im getting the below error while setting timer over an entity bean using 
'timerService.createTimer(date, entitybean);'. I have heard this problem could 
arise out of using two local datasources but Im using only one. 

19:12:32,534 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
  | javax.ejb.EJBTransactionRolledbackException: Failed to create timer
  | at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
  | at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
  | at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
  | 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:77)
  | at 
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  | 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:304)
  | at 
org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:81)
  | at 
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
  | at $Proxy101.addTimerToSale(Unknown Source)
  | at 
com.um2.mauction.session.wrapper.AuctionBean.addAuction(AuctionBean.java:120)
  | 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.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
  | at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
  | 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:77)
  | at 
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  | 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.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:103)
  | at 

[jboss-user] [EJB 3.0] - Re: Exception on trying to persist more than one object

2008-08-19 Thread jaki
I added em.flush() just under em.persist() and it's solved the above problem. 
Hope this helps someone in the future.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171235#4171235

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171235
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossWS] - SimpleDeserializer error on returning complex type

2008-08-19 Thread jaki
Hi, 

I have exposed a stateless ejb3 bean as a WS and it has a method returning a 
complex type.

Signature:

@WebMethod
  | public MapBean getMap(String test)

The class MapBean just has 2 string members along with their getters/setters.

I'm using an axis WS client for it (using the Call interface) but invoking the 
Web service gives me the below error:
Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child 
element, which is NOT expected, in something it was trying to deserialize.
  | at 
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
  | at 
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
  | at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
  | at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
  | at 
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
  | at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
  | at org.apache.axis.client.Call.invoke(Call.java:2448)
  | ... 3 more 

What's wierd is, it works without the error if I change the binding from 
document/wrapped to document/BARE but in that case the input arguements take 
the form 'arg0 xsi:type='xsd:string' 
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
xmlns:xsd='http://www.w3.org/2001/XMLSchema'nabble/arg0' even inside the 
webmethod! Kindly help me here. 

WSDL for response:

xs:complexType name=getMapResponse
  | xs:sequence
  |  xs:element minOccurs=0 name=return type=tns:mapBean/
  | /xs:sequence
  |/xs:complexType
  |xs:complexType name=mapBean
  | xs:sequence
  |  xs:element minOccurs=0 name=key type=xs:string/
  |  xs:element minOccurs=0 name=value type=xs:string/
  | /xs:sequence
  |/xs:complexType

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171275#4171275

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171275
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: best way to expose ejb3 as web service?

2008-08-18 Thread jaki
Hi again, 

Is it not possible to return a map/hashmap from the ejb web service? I'm using 
an axis client for that as below Call call= (Call) service.createCall();
  |call.setTargetEndpointAddress( new 
java.net.URL(endpoint) );
  |call.setOperationName(new 
QName(http://session.um.com/;, getAuc) );
  | 
  |  
  |call.addParameter(arg0,
  |  org.apache.axis.Constants.XSD_INT,
  |  javax.xml.rpc.ParameterMode.IN);
  |  
  |  
  |call.setReturnClass(HashMap.class);
  |HashMap ret =  (HashMap) call.invoke( new Object[] {1}

Thought it throws no error, the returned Map  never has any contents in them. 
Also, if instead of setReturnClass I try to use 
setReturnType(org.apache.axis.Constants.XSD_ANY) it gives me the below error:

could not find deserializer for type {http://www.w3.org/2001/XMLSchema}any

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170986#4170986

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170986
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Exception on trying to persist more than one object

2008-08-18 Thread jaki
Anyway to write an object into the db as soon as em.persist is called? I think 
this will solve the above problem. Kindly help

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4171086#4171086

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4171086
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Exception on trying to persist more than one object

2008-08-15 Thread jaki
I get the following exception on trying to persist more than one bean object: 

anonymous wrote : 
  | Caused by: org.hibernate.TransientObjectException: object references an 
unsaved transient instance - save the transient instance before flushing: 
com.um2.mauction.entity.Enchere.bidder - com.um2.mauction.entity.Utilisateur
  | at 
org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:353)
  | at org.hibernate.engine.Cascade.cascade(Cascade.java:139)
  | at 
org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
  | at 
org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
  | at 
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
  | at 
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
  | at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
  | at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
  | ... 48 more
  | 

The objects to be added are related to each other via foreign keys so I'm 
guessing it's because a dependent object can't find the parent object in the 
database (which is getting persisted just above in the same function). Anyway 
to remedy this behaviour?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170757#4170757

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170757
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: best way to expose ejb3 as web service?

2008-08-14 Thread jaki
Method in the stateless bean:



@SuppressWarnings(unchecked)
  | public User check(String login,String mdp) 
  | {   
  | CollectionUser users = new HashSetUser();
  | 
  | users = em.createQuery( SELECT u  +
  | FROM User u  +
  | where 
user_login_id=' + login + ' and pass='+ mdp +').getResultList();
  | User u = null;
  | for (IteratorUser iterator = users.iterator(); 
iterator.hasNext();) 
  | u = iterator.next();
  | return u;   
  | }

Method in the exposed stateless bean trying to call the above method :

@SuppressWarnings(unchecked)
  | public Utilisateur check(String login,String mdp) 
  | {   
  | CollectionUtilisateur users = new HashSetUtilisateur();
  | 
  | System.out.println(ENTERED USER CHECK +login+mdp);
  | 
  | Object random = em.createQuery(Select count(u)+from 
Utilisateur u).getSingleResult();
  | 
  | users = em.createQuery( SELECT u  +
  | FROM 
Utilisateur u  +
  | where 
user_login_id=' + login + ' and motdepasse='+ mdp +').getResultList();
  | Utilisateur u = null;
  | for (IteratorUtilisateur iterator = users.iterator(); 
iterator.hasNext();) 
  | u = iterator.next();
  | return u;   
  | }


Stack trace: anonymous wrote : 
  | Caused by: java.lang.NullPointerException
  | at com.session.impl.UserManagerBean.check(UserManagerBean.java:122)
  | at com.session.impl.UserBean.check(UserBean.java:37)
  | 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.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
  | ... 39 more

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170481#4170481

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170481
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: best way to expose ejb3 as web service?

2008-08-14 Thread jaki
I posted the wrong code in the 2nd code section in the above post. Below is the 
correct one: 

@WebMethod
  | public String checkLogin(String id, String pass)
  | {   
  | User u = new UserManagerBean().check(id,pass);
  | 
  | if(u==null)
  | {
  | return Invalid Username / Password;
  | }
  | else
  | {
  | return Success;
  | }
  | return u;   
  | }



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170484#4170484

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170484
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: best way to expose ejb3 as web service?

2008-08-14 Thread jaki
That worked! Much thanks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170582#4170582

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170582
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: best way to expose ejb3 as web service?

2008-08-13 Thread jaki
Thanks, that worked!

But I have got another problem now. To avoid changing the existing stateless 
beans, for each, I have created a wrapper sort of stateless bean having the web 
service annotations and calling the methods in the existing beans. (This had to 
be done since the client app can't recognize many of the objects taken as 
parameters by methods of the existing beans.) But calling a method from the 
wrapper bean having a createQuery statement throws a NullPointerException. Any 
idea on why this might be?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170358#4170358

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170358
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - best way to expose ejb3 as web service?

2008-08-12 Thread jaki
I have an ejb3 component with a number of stateless and entity beans. What's 
the best and easiest way to expose the stateless beans as web services? Which 
method will require the least changes to be made to the beans themselves?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4170095#4170095

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4170095
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JNDI/Naming/Network] - Re: classCastException while casting ejb Home's proxy.

2008-07-28 Thread jaki
Hi all, 
I have got the ClassCastException too. Im using eclipse and on viewing the 
Build path for the webcomponent I can see that there's a 'class folder' 
referencing the ejb module as well as a jar for the ejb in the 'web app' 
library. Which excly should I remove?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4167215#4167215

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4167215
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user