RE: [JBoss-user] problem with stateful session bean
Leo, Maybe your bean is invalidated because you get a Runtime exception somewhere in your code but you keep using the instance? cheer, Joost :-) -Original Message- From: Leonard Wolters Sent: Thursday, April 11, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] problem with stateful session bean Hello, I have a problem with stateful session beans. After successfully deploying this bean, I'm able to access this bean and call any method. However, when calling a second method, I receive a ' NoSuchObjectException' (see below). [j2eejunit] RemoteException occurred in server thread; nested exception is: [j2eejunit] java.rmi.NoSuchObjectException: Could not activate; nested exception is: [j2eejunit] java.io.FileNotFoundException: D:\development\java\rkm\JBoss-Tomcat\jboss\db\sessions\smarthaven.doccompare.DocumentComparat or\101852411.ser (The system cannot find the file specified) As one can see, JBoss is trying to 'activate' my session bean (or something else ?) This however is quite strange since my session bean has not been passivated yet ! BTW: both methods are called directly after each other, i.e. within milliseconds. Most probably, i'm forgetting something in the deployment descriptor. It seems that for any method call a new session bean is created ? Does anyone has any suggestions what the problem can be ? T.i.a., Leonard Wolters ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Strange problem
Hi, This could be due to the fact that you are trying to store and read all in one transaction, if the transaction isn't committed, the row is not yet inserted in the database. Joost. -Original Message- From: Mahesh Agarwal [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 6:55 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] Strange problem Hi Everybody I am facing a very strange problem in my application which is running in Jboss. I am creating a "Request" in my application and saving that "Request" in the database(MySql), that mean, I inserted a new row in a table. When I come to my application again to see that "Request" , the application says that "unable to find the request". Strange!! But when I tried for next time, the application shows the "Request" without any exception. This problem is not repeatable but occurs very frequently. Please give me some suggestion regarding this error. Thanks a lot in advance Mahesh ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JBossMQ selector question
Hi,I have a QueueBrowser that is polling a queue. I display this queue in a Swing client. When the user takes an action I want to get the message from the queue, so I make a selector based on the JMSMessageID. Unfortunately this doesn't seem to work.. can somebody tell me what I'm doing wrong? Below is a code snippet..thanx,JoostString selector = "JMSMessageID='" + msg.getJMSMessageID() + "'";// fetch it from the queueQueueReceiver receiver = session.createReceiver(queue,selector);msg = receiver.receiveNoWait();if(msg != null) {// ok .. we have it put it in some other listSystem.out.println("Got Message");} else {// @todo: show dialogSystem.out.println("Message not available anymore");}// close the receiverreceiver.close();
RE: [JBoss-user] JBoss CMP with MySQL?
Title: JBoss CMP with MySQL? Look at you URL attribute, you are missing a 'c' NullPointer on getConnection is always a config problem Joost. -Original Message-From: JD Brennan [mailto:[EMAIL PROTECTED]]Sent: Friday, March 15, 2002 1:55 AMTo: JBoss Users (E-mail)Subject: [JBoss-user] JBoss CMP with MySQL? I'm trying to get JBoss 2.4.4 working with MySQL 3.23 with the mm.mysql-2.0.11 driver: org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl MySQLPool jdb:mysql://mysql1/test foo bar I get this error: [ERROR,MySQLPool] Stopped java.lang.NullPointerException at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source) at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:412) at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103) at java.lang.reflect.Method.invoke(Native Method) ... I checked out jboss-all from CVS (branch Rel_2_4_4_15), but can't find XAPoolDataSource.java so I decompiled it (with jad) and noticed that it has some log.trace() calls, so I modified the log4j.properties file and tried to turn on tracing by adding: log4j.category.org.jboss.pool=TRACE But that didn't work. So that leaves me with 3 questions: 1) Did anyone get MySQL to work with JBoss CMP? 2) Where do I get the source for XAPoolDataSource 3) How do I turn on tracing? Thanks very much! JD
RE: [JBoss-user] EJB in ear referencing EJB outside of ear
Hi, If you deploy a bean outside an ear file (e.g. as a bean-jar not as another ear file) you can reference the bean only with it's JNDI name. You can't user java:comp/env/ejb namespace bacause that can only be used within one enterprise archive. So if the jndi name of your bean is "MyBean" then just call InitialContext.lookup("MyBean") and you'll be alright. (at least I am when I do this). If the problem persists, maybe you can provide a stacktrace for the CommunicationException.. cheers, JOost. -Original Message- From: Richard Doust [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 4:51 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] EJB in ear referencing EJB outside of ear Hi. I'm confused by the J2EE Spec. I know it's possible for an EJB packaged in a jar and deployed inside of an ear to reference an EJB that does not exist inside the ear. I have gone from packaging all EJBs inside the ear to deploying one externally, (on my way to deplolying most of them externally), so that a different application deployed in the same container can access the EJBs without having to have the EJBs packaged inside two different ears. I've modified my deployment descriptors according to the specification, and when I run JBoss, the JNDIView shows me that all of the namespaces are established as I would expect. Yet, when I try to access the externally deployed EJB from an EJB inside the ear (doing a lookup on its Home using InitialContext), I get a CommunicationException. From the description, it seems like a weird exception to have. If anyone is interested in trying to help me figure this out, I could provide more details. Thanks. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] cmp primary key
Frank, I have found that it is the easiest to use a UUID that combines the time with some random number in a java Long object. These values are so ridiculously big that it is almost impossible to get a duplicate key, but of course you have to make arrangements in your code to catch the DuplicateKeyException and generate a new key, but I can assure you that this will not happen often... Joost. -Original Message- From: Frank Morton [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 7:40 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] cmp primary key I'm a newbie for sure, but I've been surfing around for a solution to assigning unique primary key values with CMPs. I have seen lots of vague descriptions of how to do it and some specific ones that are all followed by other comments from people why that solution doesn't work. Does anyone have a specific solution and the complete code to do this they can share? This seems like it must be a very common problem that ought to have a standard solution. Help. I'm really getting frustrated. Frank ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Select COUNT????? in Entity
Hi, You're doing a BMP bean, so you work with jdbc already, why don't you just define a method count() on the bean and call "SELECT COUNT * FROM blabla" on the datasource In my opinion you don't have to use only findBYXXX methods... Joost. -Original Message- From: John LYC [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 16, 2001 5:08 AM To: Jboss Mailing List Subject: [JBoss-user] Select COUNT? in Entity Hi all, I'm using Bean-managed Entity Beans.. and i wanna do a sql "select count".. the thing is the finder methods in entity can only return the beans remote type or a collection of it. meaning i cannot select count . How do i do a sql "count"? one way to do work around i guess is to do a sql "select" as per normal , return collection. and do a collection .size. but this seems redundant. i just wan a figure. instead i'm selecting a collection of beans help thanks john ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
FW: [JBoss-user] newbie session bean question
Hi, If the data you're caching is common to all clients (e.g. no "state" information) you're better off using a stateless session bean.. Depending on the load of your machine you'll have one or more instances of this bean cached and ready to server your clients.. Why would you want to have one instance of this bean? The methods are synchronized anyway by the container, if it gets two method calls at the same time, it will spawn a new instance of the bean (which of course has to load it's cache which will take some time) and serve the client from this new bean. If the method returns, the bean will be placed back in the instance cache ready to serve another client request... Hope this helps you, Joost. -Original Message- From: Frank Morton [mailto:[EMAIL PROTECTED]] Sent: Saturday, October 13, 2001 8:19 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] newbie session bean question I'm still learning this stuff... I would like to have what I think would be a stateful session bean, but I need to only have one instance of the bean system wide with synchronized access to the members. It is caching some stuff. Can someone give me a guide how to do this or refer me to somewhere that explains some of this. Thanks from the newbie. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] jboss - castor class loading problem
Title: jboss - castor class loading problem Hi, I'm currently testing with jboss and castor to do the object-relational mapping, but I get the following exception: [Default] org.exolab.castor.mapping.MappingException: Could not find the class com.smarthaven.component.profiler.Profile [Default] at org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoader.java:300) [Default] at org.exolab.castor.jdo.engine.JDOMappingLoader.createDescriptor(JDOMappingLoader.java:147) [Default] at org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:211) [Default] at org.exolab.castor.jdo.engine.JDOMappingLoader.loadMapping(JDOMappingLoader.java:294) [Default] at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:278) [Default] at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:317) [Default] at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:465) [Default] at com.smarthaven.component.profiler.ProfileManagerBean.createGroup(ProfileManagerBean.java:57) [Default] at java.lang.reflect.Method.invoke(Native Method) [Default] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:54 3) [Default] at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:276) [Default] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor. java:87) [Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128) [Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) [Default] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286) [Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:395) [Default] at java.lang.reflect.Method.invoke(Native Method) [Default] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:242) [Default] at sun.rmi.transport.Transport$1.run(Transport.java:155) [Default] at java.security.AccessController.doPrivileged(Native Method) [Default] at sun.rmi.transport.Transport.serviceCall(Transport.java:152) [Default] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:462) [Default] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:662) [Default] at java.lang.Thread.run(Thread.java:498) The profile class is part of je beans.jar. I suspect it is a class-loading problem, has anybody seen this before? thanx, Joost.
RE: [JBoss-user] Stateless Session remove() question
No, actually, after each remote method call the instance is placed back into the pool, you can never be sure that the next call on the same remote object will use the dame instance.. Joost. -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 09, 2001 4:52 PM To: David Ward Cc: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Stateless Session remove() question afaik the server will only let one thread in a SLSB at a time, so I assume that the container will hold the instance as "busy" until you call remove. not based on any knowledge of the internals... cheers dim On Tue, 9 Oct 2001, David Ward wrote: > Is there any benefit / penalty for calling or not calling remove() on > the remote interface of my stateless session bean? According to the > ejb1.1 spec diagrams, it looks like ejbRemove will only get called on a > stateFUL session bean. Should I or should I not be calling remove() > when I'm done? > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] stateless session bean pooling seems to have disappeared in jboss2.4?????
Hi, Update to 2.4.3, it will solve your problem. Somebody removed the instance caching of stateless beans in 2.4.1, instead a new instance is made each time. cheers, Joost. -Original Message- From: Noels Jeroen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 09, 2001 2:56 PM To: '[EMAIL PROTECTED]' Subject: [JBoss-user] stateless session bean pooling seems to have disappeared in jboss2.4? hi, We have been using jboss 2.2.1 for about half a year, and I think this a great product. Recently we upgraded to jboss 2.4.1, without any problems whatsoever. However, it appears to me that jboss 2.2.1 and jboss 2.4.1 behave very differently in dealing with the pooling of stateless session beans: I deployed exactly the same beans in both jboss versions, with the same (in fact: the default) container configurations and investigated jboss-logging and some customized logging in our beans about their life-cycle events. In 2.2.1, this kind of logging convinces me that stateless session beans are indeed pooled and reused. However it seems that in 2.4.1 this is no longer the case: no-arg-constructors, setSessionContext() and ejbCreate() methods are called over and over again, even when I reduce the pool-size to say 2 instances! please help!!! Jeroen Noels ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JNDIMapMBean - ClassCastException
oops, correction: Owen=Holger and reference.getRefAddr(0).getObject() = reference.getRefAddr(0).getContent(); Joost. -Original Message- From: Joost v.d. Wijgerd Sent: Friday, September 28, 2001 3:28 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] JNDIMapMBean - ClassCastException Owen, Are you sure that you are binding a HashMap object under the jndi name? It looks as though it is a entirely different object. I looked up the javadoc for javax.naming.Reference (the object you're actually getting) and it reads: "Reference provides a way of recording address information about objects which themselves are not directly bound to the naming/directory system." so it seems that you didn't bind the object properly. Another thought that springs to mind is that a HashMap is not a remote object, and since you appear to be using RMI-IIOP it cannot be directly bound. SO you should either create a RemoteObject that wraps the hashmap, or try to see whether you can get to the data throught the Reference object. e.g. reference.getRefAddr(0).getObject(); (I haven't tried this but it would be the first thing I would try) Good luck, Joost. -Original Message- From: Sitepark [mailto:[EMAIL PROTECTED]] Sent: Friday, September 28, 2001 2:34 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] JNDIMapMBean - ClassCastException Hi, thanks for reply. But now I get this exception: Exception in thread "main" java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Portable RemoteObject.java:296) at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) Holger On Fri, 28 Sep 2001 13:37:43 +0200 "Joost v.d. Wijgerd" <[EMAIL PROTECTED]> wrote: > Hi, > > You always want to narrow your objects: > > Object ref = ctx.lookup("inmemory/maps/MapTest"); > > HashMap map = (HashMap) > PortableRemoteObject.narrow(ref, HashMap.class); > > This is because implementations of corba are not required to give you > the object reference directly. > > Hope this helps, > > Joost. > > -Original Message- > From: Sitepark [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 28, 2001 1:02 PM > To: [EMAIL PROTECTED] > Subject: [JBoss-user] JNDIMapMBean - ClassCastException > > > Hi, > > I follow the HOWTO to integrate a Custom Service via MBeans. > It work's > > But my Client dont't work. > > I get this exception: > Exception in thread "main" java.lang.ClassCastException: > javax.naming.Reference > > I use this: > InitialContext ctx = new InitialContext(); > HashMap map = (HashMap) ctx.lookup("inmemory/maps/MapTest"); > > Can anyone help? > > Many thanks > > Holger > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JNDIMapMBean - ClassCastException
Owen, Are you sure that you are binding a HashMap object under the jndi name? It looks as though it is a entirely different object. I looked up the javadoc for javax.naming.Reference (the object you're actually getting) and it reads: "Reference provides a way of recording address information about objects which themselves are not directly bound to the naming/directory system." so it seems that you didn't bind the object properly. Another thought that springs to mind is that a HashMap is not a remote object, and since you appear to be using RMI-IIOP it cannot be directly bound. SO you should either create a RemoteObject that wraps the hashmap, or try to see whether you can get to the data throught the Reference object. e.g. reference.getRefAddr(0).getObject(); (I haven't tried this but it would be the first thing I would try) Good luck, Joost. -Original Message- From: Sitepark [mailto:[EMAIL PROTECTED]] Sent: Friday, September 28, 2001 2:34 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] JNDIMapMBean - ClassCastException Hi, thanks for reply. But now I get this exception: Exception in thread "main" java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Portable RemoteObject.java:296) at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) Holger On Fri, 28 Sep 2001 13:37:43 +0200 "Joost v.d. Wijgerd" <[EMAIL PROTECTED]> wrote: > Hi, > > You always want to narrow your objects: > > Object ref = ctx.lookup("inmemory/maps/MapTest"); > > HashMap map = (HashMap) > PortableRemoteObject.narrow(ref, HashMap.class); > > This is because implementations of corba are not required to give you > the object reference directly. > > Hope this helps, > > Joost. > > -Original Message- > From: Sitepark [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 28, 2001 1:02 PM > To: [EMAIL PROTECTED] > Subject: [JBoss-user] JNDIMapMBean - ClassCastException > > > Hi, > > I follow the HOWTO to integrate a Custom Service via MBeans. > It work's > > But my Client dont't work. > > I get this exception: > Exception in thread "main" java.lang.ClassCastException: > javax.naming.Reference > > I use this: > InitialContext ctx = new InitialContext(); > HashMap map = (HashMap) ctx.lookup("inmemory/maps/MapTest"); > > Can anyone help? > > Many thanks > > Holger > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JNDIMapMBean - ClassCastException
Hi, You always want to narrow your objects: Object ref = ctx.lookup("inmemory/maps/MapTest"); HashMap map = (HashMap) PortableRemoteObject.narrow(ref, HashMap.class); This is because implementations of corba are not required to give you the object reference directly. Hope this helps, Joost. -Original Message- From: Sitepark [mailto:[EMAIL PROTECTED]] Sent: Friday, September 28, 2001 1:02 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] JNDIMapMBean - ClassCastException Hi, I follow the HOWTO to integrate a Custom Service via MBeans. It work's But my Client dont't work. I get this exception: Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference I use this: InitialContext ctx = new InitialContext(); HashMap map = (HashMap) ctx.lookup("inmemory/maps/MapTest"); Can anyone help? Many thanks Holger ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Passivating EJBs
Hi, You have a reference to a connection in your Stateful session bean. When the been is passivated it is basically serialized to a persistent store (e.g. disk). Obviously it tries to serialize all you fields. What you should do is drop the reference to the connection (or make the field trainsient) and reinitialize when ejbActivate is called (or in setEntityContext() ). cheers, Joost. -Original Message- From: Jarecsni Janos [mailto:[EMAIL PROTECTED]] Sent: Friday, September 28, 2001 11:47 AM To: JBoss-List Subject: [JBoss-user] Passivating EJBs Hi, thanks for your answers to my previous question ("Performance..."). I got "a bit" more confident that this project will finally succeed - thanks to JBoss :) Now we got a little problem, which I'm sure is a consequence of our misunderstanding of some basic rules... When JBoss tries to passivate some EJBs, we get the following exception: [Container factory] java.rmi.ServerException: Could not passivate; nested exception is: [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148) [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) [Container factory] at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:182 7) [Container factory] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:48 0) [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) [Container factory] at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSes sion (StatefulSessionFilePersistenceManager.java:285) [Container factory] at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSes sion InstanceCache.java:67) [Container factory] at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCa che. java:709) [Container factory] at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:199) [Container factory] at java.lang.Thread.run(Thread.java:484) We - following the Petstore example - have a member variable of a javax.sql.DataSource in each of our beans that will want to access the database. In each method we ask for a connection from this datasource. Now it's obvious that this object is not serializable. My question is how to work this problem around? I mean if I ask for a DataSource in each method (so that no such member variable exist) won't it slow down these methods a lot (JNDI lookups...). Or is there any other ways to do it? Thanks very much in advance. Cheers, Janos Budapest, Hungary. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Problem with deploying a CMP2.0 EJB on Jboss3.0
Sorry, you are totally right, my mistake.. I'm still working with 1.1 and have had not time to educate myself on 2.0 Joost. -Original Message- From: Hunter Hillegas [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 5:18 PM To: JBoss 2 Subject: Re: [JBoss-user] Problem with deploying a CMP2.0 EJB on Jboss3.0 Are you sure about this? Everything I've read about EJB2.0 is that bean classes now ARE defined as abstract. Hunter > From: "Joost v.d. Wijgerd" <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Fri, 21 Sep 2001 13:38:29 +0200 > To: <[EMAIL PROTECTED]> > Subject: RE: [JBoss-user] Problem with deploying a CMP2.0 EJB on Jboss3.0 > > your bean class should not be abstract, you either extend > this abstract class, in which you implement ejbCreate and > put in your deployment descriptor as the bean class, or you > make it a normal class, and implement ejbCreate()... and all > your getters and setters > > Joost. ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Error in 2.4.1
This is not a bug in Jboss, you should close your connections for them to be released back into in the pool. The javadoc for java.sql.Connection.close() says: "Releases a Connection's database and JDBC resources immediately instead of waiting for them to be automatically released". automatic release will happen when the object is garbage collected... In general, you should always be careful with your resources Joost. -Original Message-From: Edson Carlos Ericksson Richter [mailto:[EMAIL PROTECTED]]Sent: Friday, September 21, 2001 2:57 PMTo: [EMAIL PROTECTED]Subject: Re: [JBoss-user] Error in 2.4.1 Hi! I've discovered the problem. At some point of view, is a JBoss bug too. What I'm doing wrong is that I never close ResultSet, Statement and Connection. At other side, after reaching limits from my Sybase SQL Server (25 connections), JBoss just freeze in responding any client (neihter Stateless, Statefull nor Entities)... Thanks, Edson Carlos Ericksson Richter Gerente de Projetos ECONET Soluções Web Distrito Federal - Brasil - Original Message - From: Edson Carlos Ericksson Richter To: [EMAIL PROTECTED] Sent: Wednesday, September 19, 2001 9:25 PM Subject: [JBoss-user] Error in 2.4.1 I'm using JBoss 2.4.1 with Tomcat 3.2.3. I've a simple StatefullSession bean that, in some places acts as stateless (offering to my pages some services). I'm using only a method - List getCustomersByName( String name ) - that returns an ArrayList of javabens containing some data from my customers. The sequence is Search Page -> submit -> getCustomersByName -> Results Page. If I go back to Search Page and repeat process 20 or more times, JBoss giveme following error: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: javax.transaction.TransactionRolledbackException: Application Error: tried to enter Stateful bean with different transaction context; nested exception is: java.rmi.RemoteException: Application Error: tried to enter Stateful bean with different transaction context javax.transaction.TransactionRolledbackException: Application Error: tried to enter Stateful bean with different transaction context; nested exception is: java.rmi.RemoteException: Application Error: tried to enter Stateful bean with different transaction context java.rmi.RemoteException: Application Error: tried to enter Stateful bean with different transaction context at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source) at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357) at org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSessionProxy.java:136) at $Proxy3.getPacientesByCodigo(Unknown Source) at cadastroPaciente._0002fcadastroPaciente_0002fLocalizarPaciente_0005f_00030_00032_0002ejspLocalizarPaciente_0005f02_jsp_8._jspService(_0002fcadastroPaciente_0002fLocalizarPaciente_0005f_00030_00032_0002ejspLocalizarPaciente_0005f02_jsp_8.java:153) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:222) at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162) at br.com.econet.ms.portalHIV.cadastroPaciente.controller.LocalizarPaciente_01WebController.action(LocalizarPaciente_01WebController.java:56) at br.com.econet.common.controller.WebController.service(WebController.java:80) at cadastroPaciente._0002fcadastroPaciente_0002fLocalizarPaciente_0005f_00030_00031_0002ejspLocalizarPaciente_0005f01_jsp_7._jspService(_0002fcadastroPaciente_0002fLocalizarPaciente_0005f_00030_00031_0002ejspLocalizarPaciente_0005f01_jsp_7.java:160) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpSe
RE: [JBoss-user] Problem with deploying a CMP2.0 EJB on Jboss3.0
your bean class should not be abstract, you either extend this abstract class, in which you implement ejbCreate and put in your deployment descriptor as the bean class, or you make it a normal class, and implement ejbCreate()... and all your getters and setters Joost. -Original Message- From: Jeroen van Erp [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 1:23 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] Problem with deploying a CMP2.0 EJB on Jboss3.0 Hello All, I'm having a problem with the deployment of a simple (2 persistent fields) Entity EJB. The Stacktrace is the following: Could not deploy file:/home/jeroen/JBoss-3.0/jboss/deploy/Default/cmpTest.jar/, Cause: org.jboss.ejb.DeploymentException: Could not deploy file:/home/jeroen/JBoss-3.0/jboss/deploy/Default/cmpTest.jar/, Cause: java.lang.NoSuchMethodException: ejbCreate at org.jboss.deployment.J2eeDeployer.startModules(Unknown Source) at org.jboss.deployment.J2eeDeployer.startApplication(Unknown Source) at org.jboss.deployment.J2eeDeployer.deploy(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:28) at java.lang.reflect.Method.invoke(Method.java:313) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at org.jboss.deployment.AutoDeployer.deploy(Unknown Source) at org.jboss.deployment.AutoDeployer.run(Unknown Source) at java.lang.Thread.run(Thread.java:539) Caused by: org.jboss.ejb.DeploymentException: Could not deploy file:/home/jeroen/JBoss-3.0/jboss/deploy/Default/cmpTest.jar/, Cause: java.lang.NoSuchMethodException: ejbCreate at org.jboss.ejb.ContainerFactory.deploy(Unknown Source) at org.jboss.ejb.ContainerFactory.deploy(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:28) at java.lang.reflect.Method.invoke(Method.java:313) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) ... 12 more Bean class: public abstract class StudentBean implements EntityBean { public abstract String getStudentId(); //prim key public abstract void setStudentId(String id); public abstract String getStudentName(); public abstract void setStudentName(String name); } localHome interface class: public interface LocalStudentHome extends EJBLocalHome { public LocalStudent create(String id, String name) throws CreateException; public LocalStudent findByPrimaryKey(String id) throws FinderException; } Local interface class: public interface LocalStudent extends EJBLocalObject { public String getStudentId(); public String getStudentName(); public void setStudentId(String id); public void setStudentName(String name); } What is wrong kindest regards, Jeroen van Erp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] problem Jboss and Tomcat
Hi, sounds like you are trying to cast a home or a remote interface to something else.. you should use PortableRemoteObject.narrow to obtain the home interface, and then the create or findByPrimaryKey methods to obtain the remote interface to your entity bean. Joost -Original Message- From: Jaime Gomez [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 2:42 AM To: [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject: [JBoss-user] problem Jboss and Tomcat I have the follow problem Error Query : java.lang.ClassCastException: $Proxy1 when invoque one enitity bean , since one aplication client i don't understand the message jaime ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] CommunicationException from lookup()
make sure you have jboss-client.jar, jnp-client.jar and jbosssx.jar in your client classpath -Original Message- From: G.L. Grobe [mailto:[EMAIL PROTECTED]] Sent: Friday, September 21, 2001 5:12 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] CommunicationException from lookup() Anyone have anyideas what causes this error. javax.naming.CommunicationException: Can't find SerialContextProvider It occurs when doing a TopicConnectionFactory lookup(). try { ctx = new InitialContext(); } catch (Exception e) { ... } try { topicConnectionFactory = (TopicConnectionFactory) ctx.lookup("TopicConnectionFactory"); ... } ... In my ~/conf/tomcat/jndi.properties file I have: --- java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.provider.url=localhost:1099 java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces # Do NOT uncomment this line as it causes in VM calls to go over # RMI! #java.naming.provider.url=localhost Any help much appreciated! ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] NPE: org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl - Oracle8i and JBoss2.4.0
Title: Paul, I've seen this error before, it usually indicates that the connection to the databasecannot be made for one reason, so check your database setup and you password/username -> configuration looks alright. Joost. -Original Message-From: Paul McLachlan [mailto:[EMAIL PROTECTED]]Sent: Wednesday, September 19, 2001 2:08 AMTo: [EMAIL PROTECTED]Subject: [JBoss-user] NPE: org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl - Oracle8i and JBoss2.4.0 Thanks Dragos, I wish that were enough . My setup is currently: oracle.jdbc.driver.OracleDriver OracleDS org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl jdbc:oracle:thin:@localhost:1521:jbossb xxx yyy I have the drivers in classes12.zip in lib/ext I still get an NPE at [XADataSourceLoader] Stoppedjava.lang.NullPointerException at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:178) I cannot afford to spend anymore time on this, I never thought at this stage of the project I would run into an issue like this. Unbelievable. Luckily I have convinced my boss that HypersonicDB will suffice for now until a future release. Paul. -Original Message-From: Dragos Haiduc [mailto:[EMAIL PROTECTED]]Sent: Monday, 17 September 2001 6:14 PMTo: [EMAIL PROTECTED]Subject: AW: [JBoss-user] Class Not Found Exception: org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl I am using JBoss2.4.0_Jetty-3.1RC8-1, but as DB i'm using Postgre, not Oracle8. This is my jboss.jcml entry for my DB connection pool:PostgreSQLDSattribute> org.jboss.pool.jdbc.xa.wrapper.XADataSourceImplattribute> jdbc:postgresql://localhost:5432/play_with_ejbsattribute> togattribute> secretattribute> mbean> -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Paul McLachlanGesendet: Montag, 17. September 2001 09:10An: [EMAIL PROTECTED]Betreff: RE: [JBoss-user] Class Not Found Exception: org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl Yes, it is. What version of JBoss are you using. I am using 2.4.0 Paul. -Original Message-From: Dragos Haiduc [mailto:[EMAIL PROTECTED]]Sent: Monday, 17 September 2001 4:41 PMTo: [EMAIL PROTECTED]Subject: [JBoss-user] Class Not Found Exception: org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl Paul, i was getting this NPE when trying to connect from JBoss to a stopped DB system(Postgre). Is ur Oracle up and running? -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Paul McLachlanGesendet: Montag, 17. September 2001 01:17An: [EMAIL PROTECTED]Betreff: RE: [JBoss-user] Class Not Found Exception: org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl Thanks Dragos, this answer looked promising but I get a NPE! [XADataSourceLoader] Stoppedjava.lang.NullPointerException at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:178) Surely someone out there must know how to use JBoss 2.4 and Oracle8! This is the class you should use in the jboss.jcml file in JBoss 2.4 for DataSource creation , not the one mentioned by you:org.jboss.pool.jdbc.xa.wrapper.XADataSourceImplBest, Dragos
RE: [JBoss-user] EJB Entity design question: Can ejbRemove() be used to modify a row in the DB?
Hi, If you are using BMP this is perfectly valid, then in the ejbFindByPrimaryKey you throw an ObjectNotFoundException when the "obsolete_indicator" column says "Y" Joost. -Original Message- From: Adam Lipscombe [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 18, 2001 1:45 PM To: JBoss User Mailing List Subject: [JBoss-user] EJB Entity design question: Can ejbRemove() be used to modify a row in the DB? Folks, I have several entity EJB's that model database tables. Rows in the tables are never physically deleted, but rather they are logically deleted by setting a "obsolete_indicator" column "Y". Can I use ejbRemove() to simply modify the row (setting this flag to "Y") or will this break application server caching? Are there any other reasons why I should not use ejbRemove()? Thanks in advance Adam ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] How can i see JNDI tree?
Title: RE: [JBoss-user] How can i see JNDI tree? the InitialContext class has functionality to iteratate over the objects bound Joost. -Original Message-From: pyliu8621 [mailto:[EMAIL PROTECTED]]Sent: Wednesday, September 19, 2001 1:01 PMTo: [EMAIL PROTECTED]Subject: Re: [JBoss-user] How can i see JNDI tree? I had put all the jar files of $JBOSS/client into classpath, then it is OK. perhaps some jar file that seem to be not important is indeed necessary. I use jboss2.2.2 In linux, I cannot get http://localhost:1099, the error is that target page cannot be found. but In windows, I can truly get http://localhost:1099, the result is a page filled with disordered characters. thanks for you all. pylio. = Original Message Here is a script that runs on unix to connect the client to a JBoss(2.2.2) container. Xerces is used by the test client and is not required. JBOSS=/opt/jboss JBOSS_CLIENT=$JBOSS/client java \ -classpath \ $CLASSPATH:$JBOSS_CLIENT/jboss-client.jar:$JBOSS_CLIENT/jbosssx-client.jar:$JBOSS_CLIENT/jnp-client.jar:/opt/xerces/xerces.jar \ -Djava.naming.provider.url=sundev3.pdsi-software.com:1099 \ -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory \ -Djava.naming.factory.url.pkgs=org.jboss.naming \ $* -Original Message- From: ALex Loubyansky [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 5:49 AM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] How can i see JNDI tree? I think, as that was mentioned, it would be sufficiently to add to classpath jndi.jar and jnp-client.jar from JBOSS_HOME/client. jalex This is my best life -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of pyliu8621 Sent: Friday, September 14, 2001 1:02 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] How can i see JNDI tree? also to Alex: I had done, but it doesn't work... when I see http://localhost:1099 this page can not be found Does it hint that jndi provider does not work? thanks > the error is : > > " Cannot instantiate class: org.jnp.interfaces.NamingContextFactory" > You need to set the class path to jnp-client.jar in jboss/client directory -- Victor Hadianto Nuix Pty. Ltd. (02) 9283 9010 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-userÿ ÿÿÉ‹,þë®f¢-)à-+-$,³û¬z¿åŠËlþÊ.ÇŸ¢¸þw†Ûi³ÿÿ-+-³û(º·~Šà{ùÞ· ùb²Û?-+-Šwèþ6è²Ïî ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user