Cart example is not stateful!?
Hi all, I need to implementing a stateful Session Bean. So, I took the Cart-example and added the following thinks to look the values of a stateful bean who shall be in the container (because by first call of this program, I added some beans). But, all Beans are destroyed. I can't see the STATEFUL beans of the last program-call! Why there not persistent? Client: // init Context java.util.Properties p = new java.util.Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory"); p.put(Context.PROVIDER_URL,"ormi://localhost/caddie"); p.put(Context.SECURITY_PRINCIPAL,"admin"); p.put(Context.SECURITY_CREDENTIALS,"metrocine"); Context context = new InitialContext(p); // get Cart bean Object homeObject = context.lookup("java:comp/env/Cart"); CartHome home = (CartHome)PortableRemoteObject.narrow(homeObject, CartHome.class); Cart cart = (Cart)PortableRemoteObject.narrow(home.create("kuno"), Cart.class); // print-out of all item stored in the stateful bean java.util.Collection items = cart.getItems(); java.util.Iterator iterator = items.iterator(); while(iterator.hasNext()){ System.out.println((String)iterator.next()); } // Add some new items to the Cart. cart.add("Milk"); cart.add("Apples"); cart.add("Pizza"); ejb-jar.xml -- ejb-jar> display-name>Caddie for the shop of Metrocine/display-name> description>prototype v1.0/description> enterprise-beans> session> display-name>Shopping Cart/display-name> description>A simple shopping cart./description> ejb-name>Cart/ejb-name> home>metrocine.caddie.interfaces.CartHome/home> remote>metrocine.caddie.interfaces.Cart/remote> ejb-class>metrocine.caddie.ejb.CartEJB/ejb-class> session-type>Stateful/session-type> transaction-type>Container/transaction-type> /session> /enterprise-beans> assembly-descriptor/> /ejb-jar> -- -- http://zap.to/kuno - Homepage - http://www.eif.ch -- -- 026/ 494.19.56 - Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
calling ProductServlet
Hey, I'm testing the Product example with EJB's. How I must call the ProductServlet? I tried to put it in the classes directory, but it doesn't work! Some one could help me? Thanks kuno -- -- http://zap.to/kuno - Homepage -http://www.eif.ch -- --026/ 494.19.56- Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
Example ProductServlet.java
Hi, I need to call the Product Bean from a Servlet. I didn't configured something special, because from the command line it works fine. So, it put the compiled file in the class directory and call it from my browser. The server response me with following message: 500 Internal Server Error javax.naming.NameNotFoundException: MyProduct not found at com.evermind.server.rmi.RMIContext.lookup(JAX) at com.evermind.server.hi.f_(JAX) at com.evermind.server.hi.lookup(JAX) at javax.naming.InitialContext.lookup(Unknown Source) at ProductServlet.init(ProductServlet.java:19) at javax.servlet.GenericServlet.init(GenericServlet.java) at com.evermind.server.http.HttpApplication.wo(JAX) at com.evermind.server.http.HttpApplication.v6(JAX) at com.evermind.server.http.HttpApplication.uh(JAX) at com.evermind.server.http.ed.sp(JAX) at com.evermind.server.http.ed.so(JAX) at com.evermind.util.f.run(JAX) It seems, that the JNDI can't find my bean! -- -- http://zap.to/kuno - Homepage - http://www.eif.ch -- -- 026/ 494.19.56 - Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
RE:Error creating cart: Error creating EntityBean: User not found: ADMIN
Ok, I found the error in the product example. I need to modifiy the admin in the db.script file of the hypersonic database. greets kuno -- -- http://zap.to/kuno - Homepage -http://www.eif.ch -- --026/ 494.19.56- Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
Error creating cart: Error creating EntityBean: User not found: ADMIN
Hi I'm using hypersonic and need to test the ejb demo product. If I start the product client there appear the following message: C:\orion\demo\ejb\productjava -classpath .;../../../orion.jar;../../../ejb.jar;../../jndi.jar ProductClient Enter the id (integer) of the product you want to add: 1 Enter the name for item 1: kuno Enter the cost for kuno: 1 Error creating cart: Error creating EntityBean: User not found: ADMIN Why it do not find the user ADMIN. Case senstitif? Thanks for all kuno -- -- http://zap.to/kuno - Homepage -http://www.eif.ch -- --026/ 494.19.56- Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
Error creating cart: Error creating EntityBean: User not found: ADMIN
Hi I'm using hypersonic and need to test the ejb demo product. If I start the product client there appear the following message: C:\orion\demo\ejb\product>java -classpath .;../../../orion.jar;../../../ejb.jar;../../jndi.jar ProductClient Enter the id (integer) of the product you want to add: 1 Enter the name for item 1: kuno Enter the cost for kuno: 1 Error creating cart: Error creating EntityBean: User not found: ADMIN Why it do not find the user ADMIN. Case senstitif? Thanks for all kuno -- -- http://zap.to/kuno - Homepage - http://www.eif.ch -- -- 026/ 494.19.56 - Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --
JSP, Beans and setProperty *
Hey If I write a line like this: jsp:setProperty name="type" property="*"/> Orion (newest version) crash! So I have do write like this: jsp:setProperty name="type" property="comment"/> jsp:setProperty name="type" property="eventTypeName"/> Do have a idea why crash's with setProperty *? Thanks kuno -- -- http://zap.to/kuno - Homepage - http://www.eif.ch -- -- 026/ 494.19.56 - Telefon - 026/ 429.66.11 -- -- [EMAIL PROTECTED] - eMail - [EMAIL PROTECTED] --