Orion with php
This is not about enabling php in Orion. I've got that working! But I had to make a small project using php against mySql, since I use Orion as development that wasn't any problem. However - I cannot connect to the database. I keep getting either TCP/IP 10091 or 10101: Cannot create socket. So I installed Apache, enabled php and voila! No problems connecting to the database. Can anybody share some light on this difference between the two? mvh / best regards Henrik Skafsgaard Larsen
OC4J datasource / server crash problem
Hi, I am currently part of a project developing a servlet/stateless EJB solution to be run on the Orion platform. We are experiencing some problems using our datasource connection to our Oracle 9i database. The server will on occasion leak connections, which eventually results in both the Orion server and the database crashing. I include our data-sources.xml file to indicate how things are set up. We currently only use the ejb-location for database access from our EJBs and servlets. ?xml version=1.0? !DOCTYPE data-sources PUBLIC Orion data-sources http://xmlns.oracle.com/ias/dtds/data-sources.dtd; data-sources !-- Setting up the data source for the zellsoft provider -- data-source class=com.evermind.sql.DriverManagerDataSource name=zellsoft location=jdbc/zellsoft xa-location=jdbc/xa/zellsoft ejb-location=jdbc/ejb/zellsoft pooled-location=jdbc/pool/zellsoft connection-driver=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@oracle.zellsoft.com:1521:UTF username=zs password=zs max-connections=20 min-connections=5 max-connect-attempts=10 connection-retry-interval=1 inactivity-timeout=30 wait-timeout=30 / /data-sources Our code for retrieval of the database connection: private static Connection getConnection( String provider, String prefix ) throws InitializerException { try { if (ic==null) ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(prefix+provider); Connection conn = ds.getConnection(); conn.setAutoCommit(false); return conn; } catch (NamingException cfe) { throw new InitializerException(Unable to lookup Datasource ); } catch (SQLException se) { throw new InitializerException(Unable to get DB connection); } } Returning the connection: public static void returnJDBCConnection(Connection conn) throws InitializerException { try { conn.close(); } catch (SQLException se) { throw new InitializerException(Unable to return DB connection); } } The exception we are getting is: OrionCMTConnection not closed, check your code! LogicalDriverManagerXAConnection not closed, check your code! Created at: java.lang.Throwable: OrionCMTConnection created at com.evermind.sql.OrionCMTConnection.init(OrionCMTConnection.java:39) at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.jav a:56) at com.zellsoft.services.dbconnection.Initializer.getConnection(Initializer .java:79) at com.zellsoft.services.dbconnection.Initializer.getJDBCConnection(Initial izer.java:46) at com.zellsoft.session.SessionManagerEJBBean.logOnAdmUser(SessionManagerEJ BBean.java:1276) at com.zellsoft.session.SessionManagerEJBBean.logOnUser(SessionManagerEJBBe an.java:1250) at com.zellsoft.session.SessionManagerEJBBean.executeCmd(SessionManagerEJBB ean.java:475) at SessionManagerEJB_StatelessSessionBeanWrapper0.executeCmd(SessionManager EJB_StatelessSessionBeanWrapper0.java:71) at com.zellsoft.media.web.adm.AmmWeb.doPost(AmmWeb.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:211) at javax.servlet.http.HttpServlet.service(HttpServlet.java:309) at javax.servlet.http.HttpServlet.service(HttpServlet.java:336) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestD ispatcher.java:508) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Servle tRequestDispatcher.java:177) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHa ndler.java:576) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java: 189) at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62) I have experiemented using the oracle.jdbc.pool.OracleConnectionPoolDataSource, but is appears to cause connections to be leaked at an even higher rate. Environment: Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode) SuSE Linux Can you say if we are doing anything wrong? I have inspected the code, and cannot find anywhere where connections are never returned. All our JDBC is within try-catch-finally blocks where returning the connection is done in the finally block. Any ideas? Ian
RE: OC4J datasource / server crash problem
You need a finally at the end of the try block's to make sure your connections close. What could be happening is your connections are not being closed from time to time. Most Oracle ora.ini files are set up for only 30 or so open connections (this is usually ok), but should never be more than 300 or so for a typical installation. Talk to your dba about this. Without the finally block, if anything goes south for the winter, the connection is just left open. The problem could also be in your jdbc try blocks. You will also need finally around these...for the same reason. Also, your autocommit needs to be triggered in the actual jdbc try block (you didn't show your dao code)...with autocommit off, transactions won't work at all unless you manage everything yourself. Make sure you are using the latest 9i version of classes12.zip in home/lib directory. Why on earth aren't you using cmp? Regards, the elephantwalker .ps Your datasource is fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ian S. Hagen Sent: Tuesday, September 11, 2001 12:21 AM To: Orion-Interest Subject: OC4J datasource / server crash problem Hi, I am currently part of a project developing a servlet/stateless EJB solution to be run on the Orion platform. We are experiencing some problems using our datasource connection to our Oracle 9i database. The server will on occasion leak connections, which eventually results in both the Orion server and the database crashing. I include our data-sources.xml file to indicate how things are set up. We currently only use the ejb-location for database access from our EJBs and servlets. ?xml version=1.0? !DOCTYPE data-sources PUBLIC Orion data-sources http://xmlns.oracle.com/ias/dtds/data-sources.dtd; data-sources !-- Setting up the data source for the zellsoft provider -- data-source class=com.evermind.sql.DriverManagerDataSource name=zellsoft location=jdbc/zellsoft xa-location=jdbc/xa/zellsoft ejb-location=jdbc/ejb/zellsoft pooled-location=jdbc/pool/zellsoft connection-driver=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@oracle.zellsoft.com:1521:UTF username=zs password=zs max-connections=20 min-connections=5 max-connect-attempts=10 connection-retry-interval=1 inactivity-timeout=30 wait-timeout=30 / /data-sources Our code for retrieval of the database connection: private static Connection getConnection( String provider, String prefix ) throws InitializerException { try { if (ic==null) ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(prefix+provider); Connection conn = ds.getConnection(); conn.setAutoCommit(false); return conn; } catch (NamingException cfe) { throw new InitializerException(Unable to lookup Datasource ); } catch (SQLException se) { throw new InitializerException(Unable to get DB connection); } } Returning the connection: public static void returnJDBCConnection(Connection conn) throws InitializerException { try { conn.close(); } catch (SQLException se) { throw new InitializerException(Unable to return DB connection); } } The exception we are getting is: OrionCMTConnection not closed, check your code! LogicalDriverManagerXAConnection not closed, check your code! Created at: java.lang.Throwable: OrionCMTConnection created at com.evermind.sql.OrionCMTConnection.init(OrionCMTConnection.java:39) at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.jav a:56) at com.zellsoft.services.dbconnection.Initializer.getConnection(Initializer .java:79) at com.zellsoft.services.dbconnection.Initializer.getJDBCConnection(Initial izer.java:46) at com.zellsoft.session.SessionManagerEJBBean.logOnAdmUser(SessionManagerEJ BBean.java:1276) at com.zellsoft.session.SessionManagerEJBBean.logOnUser(SessionManagerEJBBe an.java:1250) at com.zellsoft.session.SessionManagerEJBBean.executeCmd(SessionManagerEJBB ean.java:475) at SessionManagerEJB_StatelessSessionBeanWrapper0.executeCmd(SessionManager EJB_StatelessSessionBeanWrapper0.java:71) at com.zellsoft.media.web.adm.AmmWeb.doPost(AmmWeb.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:211) at javax.servlet.http.HttpServlet.service(HttpServlet.java:309) at javax.servlet.http.HttpServlet.service(HttpServlet.java:336) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestD ispatcher.java:508) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Servle tRequestDispatcher.java:177) at
Calling EJB From a Servlet..
HI Friends, I'm having a serious problem in my code and am unable to understand. I've deployed a simple Hello bean on the orion container and want to access it from a servlet. I have the servlet in D:\Oracle\iSuites\j2ee\home\default-web-app\WEB-INF\classes\trg\HelloServlet . Following is the code in servlet try { trace(In Try); Hashtable h = new Hashtable(); h.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,com.evermind.server.rmi. RMIInitialContextFactory); h.put(javax.naming.Context.SECURITY_PRINCIPAL, ejb); h.put(javax.naming.Context.SECURITY_CREDENTIALS, ejbadmin); h.put(javax.naming.Context.PROVIDER_URL,ormi://localhost/Hello); trace(Before Init Contect ); Context context = new InitialContext (h); trace(after Initial context); Object boundObject = context.lookup(java:comp/env/ejb/HelloHome); trace(At Trap); helloHome = (HelloHome) javax.rmi.PortableRemoteObject.narrow(boundObject,HelloHome.class); } catch (Throwable exception) { exception.printStackTrace(); //System.out.println(Look up exception : + exception.toString()); //throw new ServletException( // Unable to get home interface: + exception.toString()); } When I run servlet from browser I get an exception when the Context is getting crerated as folloew D:\Oracle\iSuites\j2ee\homejava -jar orion.jar Oracle9iAS (1.0.2.2) Containers for J2EE initialized ConstructorBefore TryIn TryBefore Init Contect java.lang.NullPointerException: d omain was null at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:428) at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:497) at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RM IInitialContextFactory.java:150) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at trg.HelloServlet.init(HelloServlet.java:49) at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication. java:1580) at com.evermind.server.http.HttpApplication.findServlet(HttpApplication. java:3722) at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApp lication.java:1995) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques tHandler.java:444) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja va:189) at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62) In _hello Please let me know where I'm going wrong. Thanks in advance Prashant
RE: OC4J datasource / server crash problem
When you get the connection you will need to put it in a try and catch. At the end use a finally to return the connection. e.g. try { Connection c = YourClass.getConnection(); } catch (SQLException ex) { //Do something with the exception } finally { YourClass.returnJDBCConnection(c); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ian S. Hagen Sent: 11 September 2001 08:21 To: Orion-Interest Subject: OC4J datasource / server crash problem Hi, I am currently part of a project developing a servlet/stateless EJB solution to be run on the Orion platform. We are experiencing some problems using our datasource connection to our Oracle 9i database. The server will on occasion leak connections, which eventually results in both the Orion server and the database crashing. I include our data-sources.xml file to indicate how things are set up. We currently only use the ejb-location for database access from our EJBs and servlets. ?xml version=1.0? !DOCTYPE data-sources PUBLIC Orion data-sources http://xmlns.oracle.com/ias/dtds/data-sources.dtd; data-sources !-- Setting up the data source for the zellsoft provider -- data-source class=com.evermind.sql.DriverManagerDataSource name=zellsoft location=jdbc/zellsoft xa-location=jdbc/xa/zellsoft ejb-location=jdbc/ejb/zellsoft pooled-location=jdbc/pool/zellsoft connection-driver=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@oracle.zellsoft.com:1521:UTF username=zs password=zs max-connections=20 min-connections=5 max-connect-attempts=10 connection-retry-interval=1 inactivity-timeout=30 wait-timeout=30 / /data-sources Our code for retrieval of the database connection: private static Connection getConnection( String provider, String prefix ) throws InitializerException { try { if (ic==null) ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(prefix+provider); Connection conn = ds.getConnection(); conn.setAutoCommit(false); return conn; } catch (NamingException cfe) { throw new InitializerException(Unable to lookup Datasource ); } catch (SQLException se) { throw new InitializerException(Unable to get DB connection); } } Returning the connection: public static void returnJDBCConnection(Connection conn) throws InitializerException { try { conn.close(); } catch (SQLException se) { throw new InitializerException(Unable to return DB connection); } } The exception we are getting is: OrionCMTConnection not closed, check your code! LogicalDriverManagerXAConnection not closed, check your code! Created at: java.lang.Throwable: OrionCMTConnection created at com.evermind.sql.OrionCMTConnection.init(OrionCMTConnection.java:39) at com.evermind.sql.OrionCMTDataSource.getConnection(OrionCMTDataSource.jav a:56) at com.zellsoft.services.dbconnection.Initializer.getConnection(Initializer .java:79) at com.zellsoft.services.dbconnection.Initializer.getJDBCConnection(Initial izer.java:46) at com.zellsoft.session.SessionManagerEJBBean.logOnAdmUser(SessionManagerEJ BBean.java:1276) at com.zellsoft.session.SessionManagerEJBBean.logOnUser(SessionManagerEJBBe an.java:1250) at com.zellsoft.session.SessionManagerEJBBean.executeCmd(SessionManagerEJBB ean.java:475) at SessionManagerEJB_StatelessSessionBeanWrapper0.executeCmd(SessionManager EJB_StatelessSessionBeanWrapper0.java:71) at com.zellsoft.media.web.adm.AmmWeb.doPost(AmmWeb.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:211) at javax.servlet.http.HttpServlet.service(HttpServlet.java:309) at javax.servlet.http.HttpServlet.service(HttpServlet.java:336) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestD ispatcher.java:508) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Servle tRequestDispatcher.java:177) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHa ndler.java:576) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java: 189) at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62) I have experiemented using the oracle.jdbc.pool.OracleConnectionPoolDataSource, but is appears to cause connections to be leaked at an even higher rate. Environment: Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode) SuSE Linux Can you say if we are doing anything wrong? I have inspected the code, and cannot find anywhere where connections are never returned. All our JDBC is within
RE: Calling EJB From a Servlet..
First, if the servlet and ejb are in the same application, you don't need to use properties to initialize your contextbut if you did, it looks like you left off the domain in the properties. Regards, the elephantwalker -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Prashant Gaikwad Sent: Tuesday, September 11, 2001 3:27 AM To: Orion-Interest Subject: Calling EJB From a Servlet.. HI Friends, I'm having a serious problem in my code and am unable to understand. I've deployed a simple Hello bean on the orion container and want to access it from a servlet. I have the servlet in D:\Oracle\iSuites\j2ee\home\default-web-app\WEB-INF\classes\trg\HelloServlet . Following is the code in servlet try { trace(In Try); Hashtable h = new Hashtable(); h.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,com.evermind.server.rmi. RMIInitialContextFactory); h.put(javax.naming.Context.SECURITY_PRINCIPAL, ejb); h.put(javax.naming.Context.SECURITY_CREDENTIALS, ejbadmin); h.put(javax.naming.Context.PROVIDER_URL,ormi://localhost/Hello); trace(Before Init Contect ); Context context = new InitialContext (h); trace(after Initial context); Object boundObject = context.lookup(java:comp/env/ejb/HelloHome); trace(At Trap); helloHome = (HelloHome) javax.rmi.PortableRemoteObject.narrow(boundObject,HelloHome.class); } catch (Throwable exception) { exception.printStackTrace(); //System.out.println(Look up exception : + exception.toString()); //throw new ServletException( // Unable to get home interface: + exception.toString()); } When I run servlet from browser I get an exception when the Context is getting crerated as folloew D:\Oracle\iSuites\j2ee\homejava -jar orion.jar Oracle9iAS (1.0.2.2) Containers for J2EE initialized ConstructorBefore TryIn TryBefore Init Contect java.lang.NullPointerException: d omain was null at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:428) at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:497) at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RM IInitialContextFactory.java:150) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at trg.HelloServlet.init(HelloServlet.java:49) at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication. java:1580) at com.evermind.server.http.HttpApplication.findServlet(HttpApplication. java:3722) at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApp lication.java:1995) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques tHandler.java:444) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja va:189) at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62) In _hello Please let me know where I'm going wrong. Thanks in advance Prashant
Transaction Rollback questions again !!
Hi All I am implementing the Session Facade design pattern in an application along with the DAOs. The deviation being no use of Entity beans. What I have apparently is as follows: 1. A Session Facade bean which has 'open new account method' for which i have defined RequiresNew transaction attribute 2. Another session bean which has 2 methods that use DAO services to insert a record in Account table and insert one entry in Customer-Account table. These session bean methods have transaction attributes set to Requires 3, In the DAO, using the Initial Context of the container, I am trying to get the connection from the connection pool of the container. In each of the above 2 methods, i get the connection from the Data source and then close it at the end. Now the problem, the transaction is not actually attributed to the method as it runs, and the first insert ( to the account table) is not rolled back though the second one (to customer-account table) is when the customer for which the account is being created does not exist !!! Any idea where i am going wrong?? Well... i am using orion 1.5.2 Thanks in advance Yash
UNSUSCRIBE
- Original Message - From: Vinay Khandelwal [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Saturday, September 08, 2001 5:46 AM Subject: UNSUSCRIBE __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
SV: OC4J datasource / server crash problem
All of out JDBC is done in a try-catch-finally block where the prepared statement and connection are closed in the finally block. Transactions are managed using CMT, and CMP is not used as stateless session EJBs make more sense in the design. Autocommit is off, allowing the container to handle committing when needed. Our transactions have been managed correctly up to now, so as far as I can see there is no problem with this. I have been using the classes12.jar and not classes12.zip, but there shouldn't be any difference between them is there? A typical database access scenario in our system is like this: getJDBCConnection and returnJDBCConnection have been provided previously. try { jdbcConn = Initializer.getJDBCConnection( providerId ); String sqlStr = SELECT STATE FROM CUSTOMERACCOUNTS WHERE MSISDN = ? + AND ( STATE='P' OR STATE='N' ); prepStmt = jdbcConn.prepareStatement( sqlStr ); prepStmt.setString( 1, msisdn ); ResultSet rs = prepStmt.executeQuery(); if ( rs.next() ) { // for prepaid, subscriptionType is P, for postpaid subscriptionType is N subscriptionType = ( P.equals( rs.getString( 1 ) ) ? P : N );// current state for msisdn validUser = true; cat.debug(isValidUserForRegistration + msisdn + exists in cust.accounts ); } else { response.setInvalidUserCondition(); cat.debug(registrtaion for + msisdn + is not ok ); } return validUser; } catch ( InitializerException ie ) { // Initializer failed somehow response.setSystemExceptionCondition(); cat.fatal( Initializer failed + ie.getMessage(), ie ); return validUser; } catch ( SQLException se ) { // select failed somehow response.setSystemExceptionCondition(); se.printStackTrace(); cat.warn( SQLException + se.getMessage(), se ); return validUser; } catch (Exception e) { e.printStackTrace(); cat.warn( Exception + e.getMessage(), e ); return validUser; } finally { // Close PreparedStatement Return JDBC connection try { if ( prepStmt != null ) prepStmt.close(); } catch (SQLException sqle) { // PreparedStatement closed already - do nothing. } try { if ( jdbcConn != null ) Initializer.returnJDBCConnection( jdbcConn ); } catch ( InitializerException ie ) { // Unable to return connection. To bad, but at least we tried. } } Hope this clarifies some issues. Ian -Oprindelig meddelelse- Fra: The elephantwalker [mailto:[EMAIL PROTECTED]] Sendt: 11. september 2001 10:09 Til: Orion-Interest Emne: RE: OC4J datasource / server crash problem You need a finally at the end of the try block's to make sure your connections close. What could be happening is your connections are not being closed from time to time. Most Oracle ora.ini files are set up for only 30 or so open connections (this is usually ok), but should never be more than 300 or so for a typical installation. Talk to your dba about this. Without the finally block, if anything goes south for the winter, the connection is just left open. The problem could also be in your jdbc try blocks. You will also need finally around these...for the same reason. Also, your autocommit needs to be triggered in the actual jdbc try block (you didn't show your dao code)...with autocommit off, transactions won't work at all unless you manage everything yourself. Make sure you are using the latest 9i version of classes12.zip in home/lib directory. Why on earth aren't you using cmp? Regards, the elephantwalker .ps Your datasource is fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ian S. Hagen Sent: Tuesday, September 11, 2001 12:21 AM To: Orion-Interest Subject: OC4J datasource / server crash problem Hi, I am currently part of a project developing a servlet/stateless EJB solution to be run on the Orion platform. We are experiencing some problems using our datasource connection to our Oracle 9i database. The server will on occasion leak connections, which eventually results in both the Orion server and the database crashing. I include our data-sources.xml file to indicate how things are set up. We currently only use the ejb-location for database access from our EJBs and servlets. ?xml version=1.0? !DOCTYPE data-sources PUBLIC Orion data-sources http://xmlns.oracle.com/ias/dtds/data-sources.dtd; data-sources !-- Setting up the data source for the zellsoft provider -- data-source class=com.evermind.sql.DriverManagerDataSource name=zellsoft location=jdbc/zellsoft xa-location=jdbc/xa/zellsoft
Re: Message Driven Bean destination-location
Darryl, First off (and I know you have probably already checked this but just in case) have you uncommented the jms.xml attribute in your server.xml file? Next if you are using Queues and QueueConnectionFactories inside orion's jms implementation you do not need to use resource-ref tag in your ejb-jar.xml your message-driven tag describes everything the container needs to know about your administered objects resourc-ref is used for attaching objects to the jndi tree but in this case all of the objects declared in your jms.xml file are already on the jndi tree. So try removing your resource-ref tags from your ejb-jar.xml and your orion-ejb-jar.xml files. Let me know if that works, SaxPosition Java Developer Exim Technologies 131 Falls St. Suite 201 Greenville, SC 29607 On 10 Sep 2001 22:32:14 -0400, Darryl Dieckman wrote: I'm trying to setup a message driven bean and am getting an error during deployment that I don't understand. Here is the error the I am getting: Auto-deploying jmsdemoEjb.jar (ejb-jar.xml had been touched since the previous deployment)... done. Error deploying file:/C:/utils/oc4j/j2ee/home/applications/jmsdemo/jmsdemoEjb.jar homes: No javax.jms.Destination found at the specified destination-location (java:comp/env/jms/theQueue) for MessageDrivenBean cache/CacheMDBean This seems to be telling me that 'theQueue' is not of the type javax.jms.Destination, correct? Here is my jms.xml: jms-server port=9127 queue-connection-factory location=java:comp/env/jms/theQueueConnectionFactory / queue name=The Queue location=java:comp/env/jms/theQueue descriptionThe JMS Demo Queue/description /queue !-- path to the log-file where JMS-events/errors are stored -- log file path=../log/jms.log / /log /jms-server And here is my ejb-jar.xml: message-driven ejb-namecache/CacheMDBean/ejb-name ejb-classcom.optimaxx.server.rms.CacheMDBean/ejb-class transaction-typeContainer/transaction-type acknowledge-modeauto-acknowledge/acknowledge-mode message-driven-destination destination-typejavax.jms.Queue/destination-type /message-driven-destination resource-ref res-ref-namejava:comp/env/jms/theQueueConnectionFactory/res-ref-name res-typejavax.jms.QueueConnectionFactory/res-type res-authContainer/res-auth /resource-ref resource-ref res-ref-namejava:comp/env/jms/theQueue/res-ref-name res-typejavax.jms.Queue/res-type res-authContainer/res-auth /resource-ref /message-driven And finally here is my orion-ejb-jar.xml: message-driven-deployment name=cache/CacheMDBean connection-factory-location=java:comp/env/jms/theQueueConnectionFactory destination-location=java:comp/env/jms/theQueue resource-ref-mapping name=java:comp/env/jms/theQueueConnectionFactory / /message-driven-deployment Any ideas? When I pull up a JNDI browser and look at what's registered, my browser shows theQueueConnectionFactory being of type com.evermind.server.jms.EvermindXAQueueConnectionFactory, and thQueue being of type com.evermind.server.jms.EvermindQueue. So I think everything is setup correctly, but I must be missing one silly little thing. help! ;) Darryl Dieckman
RE: Calling EJB From a Servlet..
Prashant, You cannot initialize the context within the servlet. Use web.xml with the following entries with your values: context-param !-- The context-param element contains the declaration of a web application's servlet context initialization parameters. There are two special kinds of initialization parameters for the optional cases where the parameter is used to obtain the JNDI name of an EJB or a data source for a subsequent look up. These are indicated by an context-param element together with an accompanying ejb-ref or resource-ref element with matching name. -- param-nametheName/param-name !-- The name of the configuration parameter. -- param-valuetheValue/param-value !-- The value of the configuration parameter. -- /context-param resource-ref !-- The optional resource-ref element contains a declaration of a Web Application's reference to an external resource. An context-param with the same name must be present whose value will be the JNDI data source. The context-param's value may be specified at deployment time. -- descriptionThe description/description !-- A short description, use etc. -- res-ref-nametheContextParam/res-ref-name !-- Specifies the name of the resource factory reference name. This value is the name of the context-param whose value contains the JNDI name of the data source. -- res-typecom.the.TypeOfResource/res-type !-- Specifies the (Java class) type of the data source. -- res-authCONTAINER|SERVLET/res-auth !-- The res-auth element indicates whether the application component code performs resource signon programmatically or whether the container signs onto the resource based on the principle mapping information supplied by the deployer. Must be CONTAINER or SERVLET. -- /resource-ref ejb-ref !-- Used in conjunction with a matching context-param of the same name to indicate that this parameter will be used to obtain the JNDI name of an EJB. -- descriptionThe description/description !-- A short description, use etc. -- ejb-ref-namenameOfEJB/ejb-ref-name !-- Contains the name of an EJB reference. This name must match an context-param name. -- ejb-ref-typecom.type.OfEJBBean/ejb-ref-type !-- Contains the expected java class type of the referenced EJB. -- homecom.type.OfEJBHome/home !-- Contains the fully qualified name of the EJB's home interface. -- remotecom.type.OfEJB/remote !-- Contains the fully qualified name of the EJB's remote interface. -- ejb-linknameOfEJB/ejb-link !-- Used in the ejb-ref element to specify that an EJB reference is linked to an EJB in an encompassing J2EE application package. The value of the ejb-link element must be the ejb-name of and EJB in the J2EE application package. -- /ejb-ref You now need to tell Orion where to find the ejb. You need to be sure that the following entries are in your hello-application.xml: application !-- The application element is the root element of a J2EE application deployment descriptor. -- module !-- The module element represents a single J2EE module and contains an ejb, java, or web element, which indicates the module type and contains a path to the module file, and an optional alt-dd element, which specifies an optional URI to the post-assembly version of the deployment descriptor. The application deployment descriptor must have one module element for each J2EE module in the application package. -- ejbpathToEJB.jar/ejb !-- The ejb element specifies the URI of a ejb-jar, relative to the top level of the application package. -- javapathToClient.jar/java !-- if you have an application client -- !-- The java element specifies the URI of a java application client module, relative to the top level of the application package. -- /module web !-- The web element contains the web-uri and context-root of a web application module. -- web-uripathTo.war/web-uri !-- The web-uri element specifies the URI of a web application file, relative to the top level of the application package. -- context-rootthedir//context-root !-- The context-root element specifies the context root of a web application. -- /web /application The module and web tags tell Orion to link these items together as an application. Now in the server.xml, make sure that the following entries are there: web-site path=./hello-web-site.xml / application name=hello path=./hello-application.xml / See if this gets us any further. Dave -Original Message- From: Prashant Gaikwad [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 11, 2001 6:27 AM To: Orion-Interest Subject: Calling EJB From a Servlet.. HI Friends, I'm having a serious problem in my code and am unable to understand. I've deployed a simple Hello bean on the orion container and want to access it from a servlet. I have the servlet in
dAHHH ... BLOODY CLOB!
Title: dAHHH ... BLOODY CLOB! OK i have taken all your advice ... and i changed it to a clob ... set up a binary stream ... wohoo ... good to go right? well WRONG! i keep getting marshalling exceptions Exception: ProjectAdd.saveInfo(): Transaction was rolled back: javax.transaction.SystemException: com.evermind.transaction.MarshallingXAException: null What am i doing right? I put the same code into a generic servlet and it worked fine ... any help would be apprecaited it :)
Dependant Entity uses DAO: shared Connection with all DAO's?
Just re-validating a design requirement for BMP that I think I read somewhere: Dependant objects behind an Entity that uses DAOs for each parent and child objects. - for container managed transactions to work, must all DAOs use the same Connection? I.E. myBeanMethod (,,,) { Connection con = null; try { // conn pool managed by J2EE container // and data-sources.xml Connection con = getDBcon(); doDAOforTableA ( ,,, con); doDAOforTableB (,,, con); } finally { freeDBcon (con); } } Thanks, curt
Re: Calling EJB From a Servlet..
If you are trying to get the ejb which deployed in another application You lookup should be directly the JNDI name of the ejb. context.lookup(ejb/HelloHome); instead of java:comp/env/xxx. If your EJB in the same application then only you can lookup from the env. - Original Message - From: Prashant Gaikwad [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Sent: Tuesday, September 11, 2001 3:26 AM Subject: Calling EJB From a Servlet.. HI Friends, I'm having a serious problem in my code and am unable to understand. I've deployed a simple Hello bean on the orion container and want to access it from a servlet. I have the servlet in D:\Oracle\iSuites\j2ee\home\default-web-app\WEB-INF\classes\trg\HelloServlet . Following is the code in servlet try { trace(In Try); Hashtable h = new Hashtable(); h.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,com.evermind.server.rmi. RMIInitialContextFactory); h.put(javax.naming.Context.SECURITY_PRINCIPAL, ejb); h.put(javax.naming.Context.SECURITY_CREDENTIALS, ejbadmin); h.put(javax.naming.Context.PROVIDER_URL,ormi://localhost/Hello); trace(Before Init Contect ); Context context = new InitialContext (h); trace(after Initial context); Object boundObject = context.lookup(java:comp/env/ejb/HelloHome); trace(At Trap); helloHome = (HelloHome) javax.rmi.PortableRemoteObject.narrow(boundObject,HelloHome.class); } catch (Throwable exception) { exception.printStackTrace(); //System.out.println(Look up exception : + exception.toString()); //throw new ServletException( // Unable to get home interface: + exception.toString()); } When I run servlet from browser I get an exception when the Context is getting crerated as folloew D:\Oracle\iSuites\j2ee\homejava -jar orion.jar Oracle9iAS (1.0.2.2) Containers for J2EE initialized ConstructorBefore TryIn TryBefore Init Contect java.lang.NullPointerException: d omain was null at com.evermind.server.rmi.RMIServer.addNode(RMIServer.java:428) at com.evermind.server.rmi.RMIServer.getConnection(RMIServer.java:497) at com.evermind.server.rmi.RMIInitialContextFactory.getInitialContext(RM IInitialContextFactory.java:150) at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at trg.HelloServlet.init(HelloServlet.java:49) at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication. java:1580) at com.evermind.server.http.HttpApplication.findServlet(HttpApplication. java:3722) at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApp lication.java:1995) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques tHandler.java:444) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja va:189) at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62) In _hello Please let me know where I'm going wrong. Thanks in advance Prashant