Re: [JBoss-user] (no subject)
You don't need both zips. jboss-tomcat*.zip is jboss AND tomcat, integrated together. jboss*.zip is jboss by itself. - Original Message - From: "Wayne Leishman" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 21, 2001 3:38 PM Subject: [JBoss-user] (no subject) Hello. I have downloaded jboss-2.1.zip and jboss-tomcat-2.1-beta.zip. I extracted JBoss to C:\JBoss and Tomcat to C:\jboss-tomcat-2.1-beta So far so good. Could someone please point me to the correct documentation on how to run Tomcat with JBoss ? I've find instructions in the following places: 1. In the new JBOSS manual, in section Running Tomcat with JBOSS at: http://www.jboss.org/documentation/HTML/ch09.html#N1d28). 2. In the JBoss 2.0 manual (PRELIMINARY) at: http://www.jboss.org/manual/third_party.html#tomcat 3. In the How-To "Tomcat + JBoss (EJB,JSP, Servlet)" at: http://www.jboss.org/business/jboss-tomcat.html The three sets of instructions are not consistant. The instructions in #1 and #2 are similar, but they refer to a package org.jboss.tomcat.EmbeddedTomcatService When I look in the JBoss.jar file I do not see this class. I see a class called TomcatService, but no EmbeddedTomcatService. The instructions in #3 are also different. I followed along with the instructions in #1/#2, and replaced org.jboss.tomcat.EmbeddedTomcatService with org.jboss.tomcat.TomcatService When I start JBoss using run.bat in JBoss\dist\bin, I get the following exceptions: [Service Control] Registered with server java.lang.NoSuchMethodException: No such constructor at com.sun.management.jmx.MBeanServerImpl.internal_instantiate(MBeanServerImpl. java:2207) at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:761) at javax.management.loading.MLet.getMBeansFromURL(MLet.java:540) at javax.management.loading.MLet.getMBeansFromURL(MLet.java:369) at org.jboss.Main.init(Main.java:160) at org.jboss.Main$1.run(Main.java:94) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.Main.main(Main.java:90) [Tomcat] Starting [Tomcat] Testing if Tomcat is present [Tomcat] failed [Tomcat] Tomcat wasn't found. Be sure to have your CLASSPATH correctly set [Tomcat] Started I realize this is a long email, but if anyone can clarify the JBoss/Tomcat setup please let me know. Thank you ! Wayne Wayne Leishman ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Mysterious deployment failure
I'm at wits end with this one. I had a perfectly good working CMP bean, that I had to modify today in two ways. 1) Change it to use a different datasource (same type, just different database), and 2) add new bean member variables, accessors, and change the create() method. So, I get all this done, and the thing refuses to deploy now! Here are the mysterious bits: - If I turn on the 'create-table' flag in jaws.xml and try to deploy the bean, the table IS correctly created, and in the expected database. That part works great. - When I took another working CMP bean, call it B, copied the various META-INF/*.xml files over from my latest bean into the bean B META-INF path, modified the names, packages, etc to fit bean Bthen bean B deployed just fine! It's table was created and JBoss issues no complaints whatsoever. Thus doesn't appear that I've screwed up the deployment descriptors in my latest bean. Below is the JBoss output when I attempt to deploy today's work. As you can see, the bean class is loaded and verified, but something goes awry after that. I can only conclude that there's something wrong with my bean classes now, but for the life of me I can't figure out what, and the JBoss logging gives no hint. Does anybody have any ideas? Thanks, Eric Auto deploy] Auto deploy of file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/deploy/PersonBean.jar [J2EE Deployer] Deploy J2EE application: file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/deploy/PersonBean.jar [J2EE Deployer] Create application PersonBean.jar [J2EE Deployer] Installing EJB package: PersonBean.jar [J2EE Deployer] Starting module PersonBean.jar [Container factory] Deploying:file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/tmp/deploy/PersonBean.jar/ejb1010.jar [Container factory] Loading ejb-jar.xml : jar:file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/tmp/deploy/PersonBean.jar/ejb1010.jar!/META-INF/ejb-jar.xml [Container factory] Loading standardjboss.xml : file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/conf/default/standardjboss.xml [Container factory] jar:file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/tmp/deploy/PersonBean.jar/ejb1010.jar!/META-INF/jboss.xml found. Overriding defaults [Verifier] Verifying file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/tmp/deploy/PersonBean.jar/ejb1010.jar [Verifier] PersonBean instantiated [Verifier] PersonBean: Verified. [Container factory] Deploying PersonBean [Container factory] Container Invoker RMI Port='' [Container factory] Container Invoker Optimize='true' [JAWS] Initializing JAWS plugin for PersonBean [JAWS] Loading standardjaws.xml : file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/conf/default/standardjaws.xml [JAWS] jar:file:/home/eric/jboss_tomcat/jboss-2.0-FINAL/tmp/deploy/PersonBean.jar/ejb1010.jar!/META-INF/jaws.xml found. Overriding defaults [J2EE Deployer] javax.management.RuntimeErrorException: Error thrown in operation deploy [J2EE Deployer] at java.lang.RuntimeException.init(RuntimeException.java:49) [J2EE Deployer] at javax.management.JMRuntimeException.init(JMRuntimeException.java:35) [J2EE Deployer] at javax.management.RuntimeErrorException.init(RuntimeErrorException.java:45) [J2EE Deployer] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1642) [J2EE Deployer] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) [J2EE Deployer] at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:645) [J2EE Deployer] at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:137) [J2EE Deployer] at java.lang.reflect.Method.invoke(Native Method) [J2EE Deployer] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628) [J2EE Deployer] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) [J2EE Deployer] at org.jboss.ejb.AutoDeployer.deploy(AutoDeployer.java:332) [J2EE Deployer] at org.jboss.ejb.AutoDeployer.run(AutoDeployer.java(Compiled Code)) [J2EE Deployer] at java.lang.Thread.run(Thread.java:498) [J2EE Deployer] Destroying application PersonBean.jar ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] java.lang.reflect.UndeclaredThrowableException
I can't find the trace. I looked in the jboss log: D:\jBoss\log\server.log and trace.log and log.pro and the tomcat logs: D:\tomcat\logs\jasper.log and servlet.log . Am I missing something? Thanks, Brian -- Brian Elliott Unplugged Systems [EMAIL PROTECTED] http://www.unpluggedsystems.com danch wrote: Take a look in the server-side log. This will give you the server side trace. Have you recently changed the throws clause of 'setDevice', but forgotten to change the interface? That's one possibility. Another possibility is that that something on the server side is throwing a strange exception, maybe even a runtime exception, and that's leaking out into the container, which catches it, notices that it wasn't declared, and throws this. The reflect comes in because JBoss uses reflection APIs to generate proxies at runtime. Brian Elliott wrote: I am getting an UndeclaredThrowableException when trying to execute a method within my Bean and not sure how to track it down. It looks like I am able to create the bean ok. Here is the code: InitialContext jndiContext = new InitialContext(); Object devRef = jndiContext.lookup("mls/DeviceIdentifier"); System.out.println("Got devRef = " + devRef); DeviceIdentifierHome devHome = (DeviceIdentifierHome) PortableRemoteObject.narrow (devRef, DeviceIdentifierHome.class); System.out.println("Got devHome = " + devHome); DeviceIdentifier deviceIdentifier = devHome.create(); System.out.println("Got create = " + deviceIdentifier); DeviceProfile device = deviceIdentifier.setDevice(DeviceType.PALM); System.out.println("Got device type = " + device.getType()); And the output: Got devRef = mls/DeviceIdentifierHome Got devHome = mls/DeviceIdentifierHome Got create = mls/DeviceIdentifier:Stateless java.lang.reflect.UndeclaredThrowableException It looks like it is choking on the setDevice call. But when I comment it out accept for one line. It still doesn't work. The one line is creating a class that is returned to the caller. How is reflect involved in all this? Any help would be appreciated. Brian ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Oracle datasource problems
Hello, I am attempting to use an oracle 8 datasource with CMP and I keep jboss to deploy the datasource. There were postings on this list that indicated successful running with configurations very similar to this. However, I keep on getting a null pointer exception when attempting to deploy the oracle datasource and would appreciate any suggestions. My jboss.jcml file has thefollowing: !-- JDBC -- mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider" attribute name="Drivers"oracle.jdbc.driver.OracleDriver,org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver/attribute /mbean . . . mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=OracleDB" attribute name="PoolName"OracleDB/attribute attribute name="DataSourceClass"oracle.jdbc.xa.client.OracleXADataSource/attribute attribute name="URL"jdbc:oracle:thin:@localhost:1521:naples"/attribute attribute name="JDBCUser"scott/attribute attribute name="Password"tiger/attribute /mbean OUTPUT: [InstantDB] Starting[InstantDB] XA Connection pool InstantDB bound to java:/InstantDB[InstantDB] The Initial Developer of the Original Code is Lutris Technologies Inc.Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies, Inc.All Rights Reserved.[Hypersonic] Press [Ctrl]+[C] to abort[InstantDB] Started[OracleDB] Starting[OracleDB] XA Connection pool OracleDB bound to java:/OracleDB[OracleDB] Stopped[OracleDB] java.lang.NullPointerException[OracleDB] at org.opentools.minerva.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:165)[OracleDB] at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:330)[OracleDB] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:93)[OracleDB] at java.lang.reflect.Method.invoke(Native Method)[OracleDB] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)[OracleDB] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)[OracleDB] at org.jboss.util.ServiceControl.start(ServiceControl.java:97)[OracleDB] at java.lang.reflect.Method.invoke(Native Method)[OracleDB] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)[OracleDB] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)[OracleDB] at org.jboss.Main.init(Main.java:190)[OracleDB] at org.jboss.Main$1.run(Main.java:94)[OracleDB] at java.security.AccessController.doPrivileged(Native Method)[OracleDB] at org.jboss.Main.main(Main.java:90)[Service Control] Could not start DefaultDomain:service=XADataSource,name=OracleDB[Service Control] java.lang.NullPointerException[Service Control] at org.opentools.minerva.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:165)[Service Control] at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:330)[Service Control] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:93)[Service Control] at java.lang.reflect.Method.invoke(Native Method)[Service Control] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)[Service Control] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)[Service Control] at org.jboss.util.ServiceControl.start(ServiceControl.java:97)[Service Control] at java.lang.reflect.Method.invoke(Native Method)[Service Control] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)[Service Control] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)[Service Control] at org.jboss.Main.init(Main.java:190)[Service Control] at org.jboss.Main$1.run(Main.java:94)[Service Control] at java.security.AccessController.doPrivileged(Native Method)[Service Control] at org.jboss.Main.main(Main.java:90)[DefaultDS] Starting[DefaultDS] XA Connection pool DefaultDS bound to java:/DefaultDS[DefaultDS] Started Thanks JGZ
Re: [JBoss-user] JAAS Based Security in JBoss
hi danch, my client/auth.conf on server side is : simple org.jboss.security.plugins.samples.SimpleServerLoginModule required; }; // The default server login module other {org.jboss.security.plugins.samples.JaasServerLoginModule required; }; session-roles { org.jboss.security.plugins.samples.JaasServerLoginModule required password-stacking="useFirstPass"; org.jboss.security.plugins.samples.RolesLoginModule required; }; yes i have a jboss.xml in my .jar's META-INF that sets: security-domainjava:/jaas/other/security-domain and only for the container config that i wil use for this sample : container-nameStandard Stateless SessionBean/container-name role-mapping-managerjava:/jaas/session-roles/role-mapping-manager and i have no old files of older version in my classpath. all jar files loaded in the classpath came from the dist/lib or dist/lib/ext where dist={jboss_home} and i have no add lines on my standardjboss.xml securefalse/secure and no security-domain no role-mapping-manager and no authentication-module where is the problem ? thierry - Original Message - From: "danch" [EMAIL PROTECTED] To: "Thierry Birre" [EMAIL PROTECTED] Sent: Wednesday, March 21, 2001 4:58 PM Subject: Re: [JBoss-user] JAAS Based Security in JBoss Hmm. This has been working for me for some time (although for the last week or so it was broken with different simptoms than yours - I don't know if this was my config or something that happened when the security was split into a separate module. At any rate CVS from this morning works.) This 'null principal' makes me wonder: what does your server-side auth.conf look like. The stock one from the JBoss build should work. Do you have a jboss.xml in your jar's META-INF that sets authentication-module and role-mapping-manager? Are you sure you don't have older (maybe JBoss 2.0) stuff on your client's classpath? Thierry Birre wrote: This message was sent from Geocrawler.com by "Thierry Birre" [EMAIL PROTECTED] yes i'm calling from a stand-alone client and i point this client to the good client/auth.conf java -Djava.security.auth.login.config=file:// ${jboss_home}/client/auth.conf SessionClient scott echoman i have exactly follow config instructions of the "JAAS Based Security in JBoss Custom Security in JBoss Using the JBossSX Framework" page of the new manual : http://www.jboss.org/documentation/HTML/ch09s32.ht ml but i always have the same error principal=null ? thanks! thierry --- I assume that you're calling from a stand-alone client? Did you point that client at the auth.conf in the JBoss_home/client directory, or the one in conf/default? The client needs to read the auth.conf from the client directory in order to Do the Right Thing. danch thierry birre wrote: hi jboss-users i'm using the last 2.1 version of jboss with embedded tomcat on windows 2000. i read the page of the new manual : http://www.jboss.org/documentation/HTML/ch09s32.ht ml after configuring all files : jboss.jcml, standardjboss.xml, auth.conf, roles.properties and users.properties all the deployment phase is ok. but when i run the SessionClient i have a remote exception : _on the client window :_ Created LoginContext [JAASSecurity] User 'scott' authenticated. Found StatelessSessionHome java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: checkSecurityAssociation; nested exception is: java.lang.SecurityException: Authentication exception java.rmi.RemoteException: checkSecurityAssociation; nested exception is: java.lang.SecurityException: Authentication exception java.lang.SecurityException: Authentication exception at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(Unknown Source) at sun.rmi.transport.StreamRemoteCall.executeCall (Unknown Source) at sun.rmi.server.UnicastRef.invoke (Unknown Source) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInv oker_Stub.invokeHome(Unknown Source) at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.in voke(HomeProxy.java:248) at $Proxy0.create(Unknown Source) at SessionClient.main (SessionClient.java:78) _on the server window :_ [J2EE Deployer Default] Deploy J2EE application: file:/C:/java/platform/dist/deploy/ssbean.jar [J2EE Deployer Default] Create application ssbean.jar [J2EE Deployer Default] install module ssbean.jar [Container factory] Deploying:file:/C:/java/platform/dist/tmp/deploy/D efault/ssbean.jar [Verifier] Verifying file:/C:/java/platform/dist/tmp/deploy/Default/ssb ean.jar/ejb1002.jar
[JBoss-user] Problem with SQL MAX() function in jaws.xml finder
I cannot get the MAX() function to work within a finder. Environment: NT 4.0, jBoss 2.1-beta with tomcat Here's my jaws.xml file: jaws enterprise-beans entity ejb-nameCustomerBean/ejb-name finder namefindNewest/name query(key = (SELECT MAX(key) FROM CustomerBean))/query !-- querykey = (SELECT COUNT(*) FROM CustomerBean)/query -- order/order /finder /entity /enterprise-beans /jaws Here's the result: [JAWS] java.sql.SQLException: Column not found: KEY in statement [SELECT key FROM CustomerBean WHERE (key = (SELECT MAX(key) FROM CustomerBean))] If, however, I use COUNT(*) instead (commented out above) I get a sensible result. Its the MAX(key) that upsets jBoss. Is this a JAWS bug? If so, is there a work-around. I would prefer not to embed my SQL. Thanks in advance... ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JBoss and Java Web Start
Hi ! We are trying to get a client application communicating with JBoss to work with Java Web Start. When creating the InitialContext, javax.naming.NoInitialContextException... (Se stacktrace). When we directly run the application, there is no problem. We tried to unpack the jnp-client and jta-spec files and included them into our own application jar file, and the same error occured ! It really looks like that the file isn't loaded into the Classpath.. but why ? Anyone having any ideas ? Regards // Johan ** System configuration Win2k JDK1.3 JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). ** The files that are included in the client classpath jboss-client.jar ejb.jar jnp-client.jar jta-spec1_0_1.jar ** Code for creating the InitialContext ... Properties contextProps = new Properties(); contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingC ontextFactory"); contextProps.put("java.naming.factory.url.pkgs", "org.jboss.naming"); if (System.getProperty(Context.PROVIDER_URL) == null) { contextProps.put(Context.PROVIDER_URL, "localhost"); } iContext = new InitialContext( contextProps ); Exception is thrown ... ** Stack trace javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) 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 se.speakup.kvalitid.jndi.InitialContextFactory.getInitialContext(InitialCont extFactory.java:44) johan.nordin SpeakUp DevCon AB Nygatan 3, 803 20 Gvle Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 Mobile +46-(0)70-778 17 70 E-mail [EMAIL PROTECTED], Web www.speakup.se ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] unscribe
unscribe = Jos Carlos Baquero Triguero C/ Tunaima 2, 4A 28033 Madrid (Spain) Tel. (+34)917646674; (+34)609604329 e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] help needed: transaction options for a simple case
An EJB solution may be an overkill, unless u're using the other services. U could use a servlet/jsp engine that does the same thing much faster. My 2c. - Original Message - From: "fractals" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 04, 2001 6:51 AM Subject: Re: [JBoss-user] help needed: transaction options for a simple case Hi again Dan, And thanks so much for your patience ! Well, this is a neat solution indeed. The fact is, I've never used transactions so I don't know what they cost. At the very moment, I am beginning an implementation using JTA. To begin with, let's say that I'll probably abandon this idea in favor to yours. But I'd just want to expose it for the sake of completeness: First off, I plan to use a centralized session management system, so I don't have to be concerned by the http server providing the web interface, i.e. there could be many http servers running servlets that access my application. To do this, I have a Stateful Session Bean I call a UserSession, which is accessed by the servlets via a Stateless Session Bean I call a Gatekeeper. Gatekeeper has a static Thread with a static Hashtable field which holds the current active sessions. The thread part is used to periodically check the time-to-live fields of the UserSessions, and decrement them appropriately (and, again, I don't know if this is really needed). By the time I was waiting to an answer to my last question, I had defined the following methods to the remote interface of UserSession: public int checkPinCode ( String pinCode ) throws RemoteException; public boolean checkPseudo ( String pseudo ) throws RemoteException; public boolean setPassword ( String password ) throws RemoteException; public void setAnnouncePrefs ( int flags ) throws RemoteException; public void setUserData ( String data ) throws RemoteException; public void finishRegistration () throws RemoteException; As I stated in my question, checking the pinCode is the first thing I do. So in UserSessionBean (the actual EJB), this is what I was doing: SessionContext context; UserTransaction ut; Connection con; public int checkPinCode ( String pinCode ) throws RemoteException { // obtain user transaction interface ut = context.getUserTransaction(); // start a transaction try { ut.begin(); } catch ( javax.transaction.NotSupportedException e ) { throw new RemoteException ( "transaction not supported" ); } catch ( javax.transaction.SystemException e ) { throw new RemoteException ( "transaction system exception " + e ); } try { makeConnection(); } catch (Exception ex) { throw new RemoteException("Unable to connect to database. " + ex.getMessage()); } try { // do the actual mess with the database... con.close (); } catch ( Exception ex ) { System.out.println ( "could not check pinCode: " + ex ); throw new RemoteException ( "checkPinCode: " + ex.getMessage () ); } return 0; } Of course, when everything finishes, I'd have to call ut.commit () (in the finishRegistration () method) or rollback on time out, etc... I'd be interested to read any comments on this, as I am at least going to try out the darn thing, unless someone tells me to just not. regards, candide You're right, you have a problem. Just off the cuff, here's what I'd think about doing. I assume this is a web app? this makes it hurt worse. This is an awfully long transaction. You really don't want a real transaction open this long. Therefore, I'd use the HTTP Session to store up all the information I need, then make a call to a stateless session bean that does all of it in one transaction. I've made comments below on what I'd do differently. On Sat, 3 Mar 2001, fractals wrote: Hi, This is a very simple question concerning transactions: I need to make a user-registration in multiple steps: 1. The user enters a pin code that corresponds to a certain amount of money he/she spent to get access to the application - application checks the pin code, and marks a corresponding pinCode EJB that the pin code is now used (it cannot be used by another user at the same time) Mark the pinCode EJB 'reserved' at this point, so that we can tell this 'in process' stuff from actually used pin codes. Save the PIN in the session. 2. The user sets his/her pseudo - application creates a new User EJB - application validates pseudo Just save the pseudo in the HTTP Session. Probably build a bean that holds pseude, password, and preferences in the session. make that bean implement the session binding listener stuff, so it knows when it times out. 3. The
Re: [JBoss-user] A little BMP philosophy/understanding
The basic EJB philosophy is to make the Bean Application developer's lives simpler by forcing the container developer to worry about all resource/object pooling, object caching, etc. In other words, all of the things you're used to doing, the container should do, plus pool the database connections so you can (given the right application architecture) get greater parallelism. JBoss, and, AFAIK, most other containers, does do caching of PreparedStatements, also. As you've noticed, when you try to do part of the container's job, bad things can happen. danch Jeff Markham wrote: I don't believe I quite have an understanding of EJBs as most of the people on this list so I'd like to ask a couple questions on BMP EJB design best-practices. In all the examples I've ever seen of BMPs, every persistence and finder method both 1) finds a DataSource and gets a Connection from it and 2) instantiates a PreparedStatement. Before looking into EJBs, I just went to the database from a servlet via JDBC. In the servlet, I would get a Connection and do all my PreparedStatements in the init() method of the servlet. On any requests that required the services of any PreparedStatement, I'd synchronize clearParameters and run it. Couldn't this same concept be done in an BMP's setEntityContext() method? Couldn't I get the Connection and do all the PreparedStatements there? It just seems that by doing a PreparedStatement in each call to the BMP's persistence and finder methods, it defeats the purpose of a PreparedStatement. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. Thoughts? Feedback? Maybe I'm misunderstanding some fundamental EJB concepts. In any case, I'd like to know what the best practices are for BMPs. Thank you. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JBoss on JDK1.2.2 working?
The binary download page of JBoss 2.1 states: It will run on both 1.2.2 and 1.3 JVMs Running the JBoss/Jetty distribution failed on my machine (WinNT4) with JDK 1.2.2 installed and ran happily after moving to JDK 1.3. Tom ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JDBCRealm , please help
Hi all, Does anyone have tried using JDBCRealm for security? I am using Jboss Pre-2.1, embedded tomcat I will to configure JBOSS to use Oracle 8i: I must absolutely configure the JBoss Autentication ? Is there some HOW TO , or samples? Thanks Joel ___ Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, Yahoo! Messenger : http://fr.messenger.yahoo.com ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] A little BMP philosophy/understanding
Someone from this discussion group indicate that container might cache the PreparedStatement. Could someone talk about the PreparedStatement lifecycle in the JBOSS EJB Container? I beleieve that will help us to understand the usage of the PreparedStatement in the EJB environment. - Mike Jau -Original Message- From: Jeff Markham [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 5:53 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] A little BMP philosophy/understanding I don't believe I quite have an understanding of EJBs as most of the people on this list so I'd like to ask a couple questions on BMP EJB design best-practices. In all the examples I've ever seen of BMPs, every persistence and finder method both 1) finds a DataSource and gets a Connection from it and 2) instantiates a PreparedStatement. Before looking into EJBs, I just went to the database from a servlet via JDBC. In the servlet, I would get a Connection and do all my PreparedStatements in the init() method of the servlet. On any requests that required the services of any PreparedStatement, I'd synchronize clearParameters and run it. Couldn't this same concept be done in an BMP's setEntityContext() method? Couldn't I get the Connection and do all the PreparedStatements there? It just seems that by doing a PreparedStatement in each call to the BMP's persistence and finder methods, it defeats the purpose of a PreparedStatement. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. Thoughts? Feedback? Maybe I'm misunderstanding some fundamental EJB concepts. In any case, I'd like to know what the best practices are for BMPs. Thank you. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] CVS is online at sourceforge
Hi -Original Message- From: Alexander Jerusalem [mailto:[EMAIL PROTECTED]] I've downloaded the cvs files from sourceforge but I wonder if this is the latest version because the Ant build file has a line: property name="version" value="2.0"/ oops - I think that was my fault... double oops - sorry for the noise - I thought this was something to do with the ant version - doh! I touched nurrthing! Chris This electronic message (email) and any attachments to it are subject to copyright and are sent for the personal attention of the addressee. Although you may be the named recipient, it may become apparent that this email and its contents are not intended for you and an addressing error has been made. This email may include information that is legally privileged and exempt from disclosure. If you have received this email in error, please advise us immediately and delete this email and any attachments from your computer system.Rabobank International is the trading name of Coperatieve Centrale Raiffeisen-Boerenleenbank B.A. which is incorporated in the Netherlands. Registered with the Registrar of Companies for England Wales No. BR002630 and regulated by the SFA for the conduct of investment business in the UK. The presence of this footnote also confirms that this email has been automatically checked by Rabobank International for the presence of computer viruses prior to it being sent, however, no guarantee is given or implied that this email is virus free upon delivery. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Oracle database pool hangs on 2.1
Off course , I ment prepareStatement and not getConnection in my previous email... [conn.prepareStatement(statementSyntax.toString(),ResultSet.TYPE_SCROLL_INSE NSITIVE,ResultSet.CONCUR_READ_ONLY);] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Guy Rouillier Sent: Thursday, March 22, 2001 5:10 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Oracle database pool hangs on 2.1 I don't understand what you are saying. The code works fine under 2.1 with Minerva. It does not work with the Oracle XA implementation. - Original Message - From: "Shahar Solomianik" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 21, 2001 7:09 AM Subject: RE: [JBoss-user] Oracle database pool hangs on 2.1 Its not Oracle problem. the same code works fine under jboss2.0 with minerva. but thanks anyway. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Guy Rouillier Sent: Wednesday, March 21, 2001 7:30 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Oracle database pool hangs on 2.1 Haven't tried the scrollable results sets. When I tried the Oracle XA implementation, I got all sorts of errors (sorry, don't remember at the moment.) I gave up at the moment and just went with minerva. Did you check the Oracle techweb site? Perhaps there is an update to the Oracle implementation. - Original Message - From: Shahar Solomianik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 20, 2001 8:55 AM Subject: RE: [JBoss-user] Oracle database pool hangs on 2.1 Hi. When I use this configuration (i.e. minerva and not oracle's XA implementation), I get exceptions when using scrollable result sets. Do you face the same problem ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Guy Rouillier Sent: Tuesday, March 20, 2001 7:56 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Oracle database pool hangs on 2.1 I followed other suggestions on this mailing list and got it to work. Here are my entries from jboss.jcml. The first is an addition to an existing entry to add the Oracle driver, while the second is a new one for the pooled connection to Oracle (adjust entries to match your database - "userid" and "password" should not be these literals, but the actual userid and password.) !-- JDBC -- mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider" attribute name="Drivers"oracle.jdbc.driver.OracleDriver,org.hsql.jdbcDriver,org.enhyd ra.instantdb.jdbc.idbDriver/attribute /mbean mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=OracleDB" attribute name="PoolName"OracleDB/attribute attribute name="DataSourceClass"org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp l/attribute attribute name="URL"jdbc:oracle:thin:@localhost:1521:homedb/attribute attribute name="JDBCUser"userid/attribute attribute name="Password"password/attribute /mbean Make sure classes12.zip is in your classpath. When you start jboss you should see the following (amongst everything else). The first group are the drivers loading, while the second group is the Oracle pooled connection being set up. [JDBC provider] Initializing [JDBC provider] Loaded JDBC-driver:oracle.jdbc.driver.OracleDriver [JDBC provider] Loaded JDBC-driver:org.hsql.jdbcDriver [JDBC provider] Loaded JDBC-driver:org.enhydra.instantdb.jdbc.idbDriver [JDBC provider] Initialized [Hypersonic] Initializing [Hypersonic] Initialized [InstantDB] Initializing [InstantDB] Initialized [DefaultDS] Initializing [DefaultDS] Initialized [OracleDB] Initializing [OracleDB] Initialized [OracleDB] Starting [OracleDB] XA Connection pool OracleDB bound to java:/OracleDB [OracleDB] Started What are you seeing or not seeing? - Original Message - From: Bolt, Dave To: [EMAIL PROTECTED] Sent: Monday, March 19, 2001 7:30 PM Subject: RE: [JBoss-user] Oracle database pool hangs on 2.1 I have the drivers in my jboss.jcml file and I get the message that the driver was loaded. But it still hangs. I can connect to the Oracle server from the same machine that I'm running JBoss from (of course I'm using OCI vs. a thin driver) as well. Any other ideas on getting a 2.1 connection pool unstuck? Dave -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:05 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Oracle database pool hangs on 2.1 Make sure you have the oracle drivers in the JdbcProvider section in jboss.jcml. Also make sure that you have the jdbc jar file in your ClassPathExtension defined in jboss.conf. Look in ../log/server.log for the message "2001-03-19 02:46:49 [JDBC provider] Loaded
[JBoss-user] JBoss user archive search doesn't work
Hi, Can anyone provide a link to search the jboss-user archive? I got an error msg everytime I tried to search via http://www.geocrawler.com/lists/3/SourceForge I got Out of Environment Space error when I run Jboss. I know some one ask the same question before. However, I can't search the archive so I'm sorry to ask again here. Thanks Pifen Ellwood ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] A little BMP philosophy/understanding
Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] UndeclaredThrowableException problems
Hi, I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. Has anybody found a solution about this problem? thanks in advance, Natxo ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] java.lang.reflect.UndeclaredThrowableException
It should have been in d:\jboss\log\server.log. Hmmm. Exceptions are logged at a fairly high level, so you would have had to go out of the way to turn them off. What's the rest of the client-side trace? Maybe something is wacky with your RMI stuff at the client. On Wed, 21 Mar 2001, Brian Elliott wrote: I can't find the trace. I looked in the jboss log: D:\jBoss\log\server.log and trace.log and log.pro and the tomcat logs: D:\tomcat\logs\jasper.log and servlet.log . Am I missing something? Thanks, Brian -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] help needed: transaction options for a simple case
On Sat, 3 Mar 2001, fractals wrote: Hi again Dan, And thanks so much for your patience ! No problem. I learn best by explaining what I (think I) know. And at least you're typing the entire word 'you' 8^}). Well, this is a neat solution indeed. The fact is, I've never used transactions so I don't know what they cost. At the very moment, I am beginning an implementation using JTA. To begin with, let's say that I'll probably abandon this idea in favor to yours. But I'd just want to expose it for the sake of completeness: First off, I plan to use a centralized session management system, so I don't have to be concerned by the http server providing the web interface, i.e. there could be many http servers running servlets that access my application. To do this, I have a Stateful Session Bean I call a UserSession, which is accessed by the servlets via a Stateless Session Bean I call a Gatekeeper. Gatekeeper has a static Thread That might work, but it won't be portable. According to the spec, EJB's can't do thread things. with a static Hashtable field which holds the current active sessions. The thread part is used to periodically check the time-to-live fields of the UserSessions, and decrement them appropriately (and, again, I don't know if this is really needed). Shouldn't be needed. Stateful session beans time out - take a look in standardjboss.xml at the Standard Stateful SessionBean container config - theres a stanza in there about the cache config that sets all that up. Accessing stateful beans from stateless makes me nervous, but I can't give you a reason offhand that it wouldn't work. By the time I was waiting to an answer to my last question, I had defined the following methods to the remote interface of UserSession: public int checkPinCode ( String pinCode ) throws RemoteException; public boolean checkPseudo ( String pseudo ) throws RemoteException; public boolean setPassword ( String password ) throws RemoteException; public void setAnnouncePrefs ( int flags ) throws RemoteException; public void setUserData ( String data ) throws RemoteException; public void finishRegistration () throws RemoteException; Looks good. As I stated in my question, checking the pinCode is the first thing I do. So in UserSessionBean (the actual EJB), this is what I was doing: SessionContext context; UserTransaction ut; Connection con; public int checkPinCode ( String pinCode ) throws RemoteException { // obtain user transaction interface ut = context.getUserTransaction(); // start a transaction try { ut.begin(); } catch ( javax.transaction.NotSupportedException e ) { throw new RemoteException ( "transaction not supported" ); } catch ( javax.transaction.SystemException e ) { throw new RemoteException ( "transaction system exception " + e ); } try { makeConnection(); } catch (Exception ex) { throw new RemoteException("Unable to connect to database. " + ex.getMessage()); } try { // do the actual mess with the database... con.close (); } catch ( Exception ex ) { System.out.println ( "could not check pinCode: " + ex ); throw new RemoteException ( "checkPinCode: " + ex.getMessage () ); } return 0; } Of course, when everything finishes, I'd have to call ut.commit () (in the finishRegistration () method) or rollback on time out, etc... I'd be interested to read any comments on this, as I am at least going to try out the darn thing, unless someone tells me to just not. Well that thread thing is non-portable, and you really don't need the gatekeeper. According to the spec, what you've done should work. regards, candide You're right, you have a problem. Just off the cuff, here's what I'd think about doing. I assume this is a web app? this makes it hurt worse. This is an awfully long transaction. You really don't want a real transaction open this long. Therefore, I'd use the HTTP Session to store up all the information I need, then make a call to a stateless session bean that does all of it in one transaction. I've made comments below on what I'd do differently. On Sat, 3 Mar 2001, fractals wrote: Hi, This is a very simple question concerning transactions: I need to make a user-registration in multiple steps: 1. The user enters a pin code that corresponds to a certain amount of money he/she spent to get access to the application - application checks the pin code, and marks a corresponding pinCode EJB that the pin code is now used (it cannot be used by another user at the same time) Mark the pinCode EJB 'reserved' at this point, so that we can tell this 'in process' stuff from actually used
Re: [JBoss-user] J2EE Blueprint Application
http://www.jboss.org/documentation/petstore-1.1.1-01.html - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 22, 2001 5:33 PM Subject: [JBoss-user] J2EE Blueprint Application What are the steps involved to get the J2EE Blueprint Application (Petstore) configured to run with the JBoss EJB Application Server? Please advise. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] JBoss user archive search doesn't work
Pifen Ellwood wrote: Hi, Can anyone provide a link to search the jboss-user archive? I got an error msg everytime I tried to search via http://www.geocrawler.com/lists/3/SourceForge I got Out of Environment Space error when I run Jboss. I know some one ask the same question before. However, I can't search the archive so I'm sorry to ask again here. Thanks Pifen Ellwood Pifen, The new sourceforge archive doesn seem to have anything yet, but the old archives can be reached at and searched from http://www.mail-archive.com/jboss-user@list.working-dogs.com/ Chris ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] J2EE Blueprint Application
[EMAIL PROTECTED] wrote: What are the steps involved to get the J2EE Blueprint Application (Petstore) configured to run with the JBoss EJB Application Server? Please advise. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user Read the following, then get the patches indicated there. http://www.jboss.org/documentation/petstore-1.1.1-01.html It's not completely foolproof, so you might want to serch the archives under "petstore" as you work with it . Chris ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JBoss user archive search doesn't work
are you running Win95 or Win98? you have to set the environment space for your dos prompt /e:4096 or something like that? Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Pifen Ellwood Sent: Thursday, March 22, 2001 8:37 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] JBoss user archive search doesn't work Hi, Can anyone provide a link to search the jboss-user archive? I got an error msg everytime I tried to search via http://www.geocrawler.com/lists/3/SourceForge I got Out of Environment Space error when I run Jboss. I know some one ask the same question before. However, I can't search the archive so I'm sorry to ask again here. Thanks Pifen Ellwood ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Please clarify JBoss and Tomcat setup
Wayne Leishman wrote: Hello. I have downloaded jboss-2.1.zip and jboss-tomcat-2.1-beta.zip. I extracted JBoss to C:\JBoss and Tomcat to C:\jboss-tomcat-2.1-beta Wayne, You don'n need both of these. jboss-tomcat-2.1-beta.zip=jboss+tomcat and all the classes you need are there. The jar in question is tomcat-service.jar, located in $JBOSS_HOME/lib/ext. If you get the jboss-contribs.zip , in the tomcat subdir you can build a tomcat test client to test your config. Chris ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] java.lang.reflect.UndeclaredThrowableException
Hmm.. I'm a bit of a newbie and I haven't read all the thread but.. ..but i had this error once with JBoss. I tracked it down to forgetting to serialize a data holder I was trying to pass using RMI. But anyway - the getUndeclaredThrowable()method got a lot more info out of the system for me. just catch it and print it Tim insert amusing but deep quote here |+--- || Dan | || Christopherso| || n| || danch@nvisia| || .com| || | || 22/03/01 | || 16:42| || Please | || respond to | || jboss-user | || | |+--- | || | To: [EMAIL PROTECTED] | | cc: (bcc: Tim Clarke/Globebyte Limited UK) | | Subject: Re: [JBoss-user]| | java.lang.reflect.UndeclaredThrowableException | | It should have been in d:\jboss\log\server.log. Hmmm. Exceptions are logged at a fairly high level, so you would have had to go out of the way to turn them off. What's the rest of the client-side trace? Maybe something is wacky with your RMI stuff at the client. On Wed, 21 Mar 2001, Brian Elliott wrote: I can't find the trace. I looked in the jboss log: D:\jBoss\log\server.log and trace.log and log.pro and the tomcat logs: D:\tomcat\logs\jasper.log and servlet.log . Am I missing something? Thanks, Brian -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] A little BMP philosophy/understanding
On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems with Oracle's cursor limit (fixed in 2.1). ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] UndeclaredThrowableException problems
What's the stack trace you see from your servlet? On Thu, 22 Mar 2001, ncabre wrote: Hi, I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. Has anybody found a solution about this problem? thanks in advance, Natxo ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Problem with ORACLE CMP and BLOBS
Hi, I'm trying to use CMP with an oracle data source. one of my CMP fields is a byte[] that can get quite large JAWS creates a table with this field mapped onto a BLOB type. When I try to create the entity if the byte[] contains several k's of data I get the following exception. [docSession] javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column Is there a way to store large objects using CMP with Oracle? In the mailing list archive there was a similar problem using BMP which required rewritting the methods ejbCreate etc. Will I have to change to BMP and work this way? Is it possible to mix BMP and CMP in the same Entity Bean? thanks -Michael [JAWS] java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column [JAWS] [JAWS] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) [JAWS] at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) [JAWS] at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) [JAWS] at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311) [JAWS] at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738) [JAWS] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313 ) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1 353) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java :1807) [JAWS] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState ment.java:332) [JAWS] at org.opentools.minerva.jdbc.PreparedStatementInPool.executeUpdate(PreparedSta tementInPool.java:82) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand.executeStatementAndHandleR esult(JDBCUpdateCommand.java:49) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159 ) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEn tityCommand.java:135) [JAWS] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPersisten ceManager.java:122) [JAWS] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManag er.java:207) [JAWS] at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine r.java:639) [JAWS] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync hronizationInterceptor.java:160) [JAWS] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt erceptor.java:87) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:445) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav a:151) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106) [JAWS] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai nerInvoker.java:425) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:212) [JAWS] at $Proxy8.create(Unknown Source) [JAWS] at com.icl.itc.doclog.document.docSession.addDocument(docSession.java:185) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS essionContainer.java:570) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:17 7) [JAWS] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess ionInstanceInterceptor.java:206) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:263) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) [JAWS] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java: 326) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI nvoker.java:381) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) [JAWS] at sun.rmi.transport.Transport$1.run(Transport.java:142) [JAWS] at java.security.AccessController.doPrivileged(Native Method) [JAWS] at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
Re: [JBoss-user] UndeclaredThrowableException problems
The stacktrace is below: java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException: MessageException: Hola soc una excepcio 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.StatelessSessionProxy.invoke(StatelessSessionProxy.java:188) at $Proxy1.getMessage(Unknown Source) at SimpleEJBClient.doGet(SimpleEJBClient.java:100) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) thanks for your interest, Natxo At 11:33 22/03/2001 -0600, you wrote: What's the stack trace you see from your servlet? On Thu, 22 Mar 2001, ncabre wrote: Hi, I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. Has anybody found a solution about this problem? thanks in advance, Natxo ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] A little BMP philosophy/understanding
Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems with Oracle's cursor limit (fixed in 2.1). I'm re-writing the minerva PreparedStatement caching so it handles cursor limit better. I'll submit the code tomorrow after I test it. Bill ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Incorrect archive links on jBoss site
The page http://www.jboss.org/business/lists.html does not properly link to the sites of the new mailing list archives for JBOSS-USER and JBOSS-DEV. For example, the JBOSS-USER Archive link takes you to http://lists.sourceforge.net/archives//jboss-user/, which is a black hole. The actual archive is accessible via http://lists.sourceforge.net/lists/listinfo/jboss-user (and is currently located at http://www.geocrawler.com/lists/3/SourceForge/10767/0/). Someone should fix this, and soon. Regards, Bob -- Robert E. Newby, President and Principal Engineer Renew Associates Incorporated, Arlington, Massachusetts USA 781.643.7084 | [EMAIL PROTECTED] | www.renewassoc.com e-Solution Consulting and Development Services | Java 2, J2EE, XML/XSLT and related technologies ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] UndeclaredThrowableException problems
Try Tim Clarke's advice, catch the UndeclaredThrowableException, call getUndeclaredThrowable and print it. This might be more enlightening. Is 'MessageException' an exception of yours? If so, is it declared as being thrown from your 'getMessage' method in both your bean and the bean's remote interface? On Thu, 22 Mar 2001, natxo wrote: The stacktrace is below: java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException: MessageException: Hola soc una excepcio 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.StatelessSessionProxy.invoke(StatelessSessionProxy.java:188) at $Proxy1.getMessage(Unknown Source) at SimpleEJBClient.doGet(SimpleEJBClient.java:100) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) thanks for your interest, Natxo At 11:33 22/03/2001 -0600, you wrote: What's the stack trace you see from your servlet? On Thu, 22 Mar 2001, ncabre wrote: Hi, I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. Has anybody found a solution about this problem? thanks in advance, Natxo ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] A little BMP philosophy/understanding
Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems with Oracle's cursor limit (fixed in 2.1). I'm re-writing the minerva PreparedStatement caching so it handles cursor limit better. I'll submit the code tomorrow after I test it. Bill ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JbossRealm
Hi! Can someone explain me, how work the JbossRealm Authentication mechanism ? For embedded tomcat, why this authentication mechanism is specified in tomcat' server.xml file ? And not in jboss.jcml ? Is there the same mechanism for JBOSS stand alone ?? Thanks Joel ___ Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, Yahoo! Messenger : http://fr.messenger.yahoo.com ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] JAAS Based Security in JBoss
If the auth.conf file in your jboss_dist/client directory is as you indicate then that is the problem. That is the auth.conf file for the server and should be in the jboss_dist/conf/default directory. You jboss_dist/client/auth.conf file should be the default one shipped with the distribution which contains: client 780cat auth.conf srp { // Example client auth.conf for using the SRPLoginModule org.jboss.srp.jaas.SRPLoginModule required password-stacking="useFirstPass" principalClassName="org.jboss.security.SimplePrincipal" srpServerJndiName="SRPServerInterface" debug=true ; // jBoss LoginModule org.jboss.security.ClientLoginModule required password-stacking="useFirstPass" ; // Put your login modules that need jBoss here }; other { // Put your login modules that work without jBoss here // jBoss LoginModule org.jboss.security.ClientLoginModule required; // Put your login modules that need jBoss here }; - Original Message - From: "thierry birre" [EMAIL PROTECTED] To: "danch" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, March 22, 2001 12:44 AM Subject: Re: [JBoss-user] JAAS Based Security in JBoss hi danch, my client/auth.conf on server side is : simple org.jboss.security.plugins.samples.SimpleServerLoginModule required; }; // The default server login module other {org.jboss.security.plugins.samples.JaasServerLoginModule required; }; session-roles { org.jboss.security.plugins.samples.JaasServerLoginModule required password-stacking="useFirstPass"; org.jboss.security.plugins.samples.RolesLoginModule required; }; yes i have a jboss.xml in my .jar's META-INF that sets: security-domainjava:/jaas/other/security-domain and only for the container config that i wil use for this sample : container-nameStandard Stateless SessionBean/container-name role-mapping-managerjava:/jaas/session-roles/role-mapping-manager and i have no old files of older version in my classpath. all jar files loaded in the classpath came from the dist/lib or dist/lib/ext where dist={jboss_home} and i have no add lines on my standardjboss.xml securefalse/secure and no security-domain no role-mapping-manager and no authentication-module where is the problem ? thierry ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Re: UndeclaredThrowableException problems
This problem has been solved some weeks ago for embedded Tomcat and current cvs JBoss. Just try the 2.1-beta release from the JBoss website. Ralf ncabre wrote: I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] unscribe
unscribe ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Problem with ORACLE CMP and BLOBS
My friend ! CMPing a LOB has not yet been proven to be possible using jboss+oracle. Even Oracle's JServer's EJB server doesnt CMP a LOB !!! (I heard it today from Oracle support, it took them 2 months to clarify this issue for me... they say : maybe Oracle9 will do it... ye right) (If you do manage to do it somehow, cry it out loud !!!) BMP it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Noonan Michael Sent: Thursday, March 22, 2001 7:59 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] Problem with ORACLE CMP and BLOBS Hi, I'm trying to use CMP with an oracle data source. one of my CMP fields is a byte[] that can get quite large JAWS creates a table with this field mapped onto a BLOB type. When I try to create the entity if the byte[] contains several k's of data I get the following exception. [docSession] javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column Is there a way to store large objects using CMP with Oracle? In the mailing list archive there was a similar problem using BMP which required rewritting the methods ejbCreate etc. Will I have to change to BMP and work this way? Is it possible to mix BMP and CMP in the same Entity Bean? thanks -Michael [JAWS] java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column [JAWS] [JAWS] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) [JAWS] at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) [JAWS] at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) [JAWS] at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311) [JAWS] at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738) [JAWS] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313 ) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1 353) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760) [JAWS] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java :1807) [JAWS] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState ment.java:332) [JAWS] at org.opentools.minerva.jdbc.PreparedStatementInPool.executeUpdate(PreparedSta tementInPool.java:82) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCUpdateCommand.executeStatementAndHandleR esult(JDBCUpdateCommand.java:49) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159 ) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEn tityCommand.java:135) [JAWS] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPersisten ceManager.java:122) [JAWS] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManag er.java:207) [JAWS] at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine r.java:639) [JAWS] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync hronizationInterceptor.java:160) [JAWS] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt erceptor.java:87) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:445) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav a:151) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106) [JAWS] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai nerInvoker.java:425) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:212) [JAWS] at $Proxy8.create(Unknown Source) [JAWS] at com.icl.itc.doclog.document.docSession.addDocument(docSession.java:185) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS essionContainer.java:570) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:17 7) [JAWS] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess ionInstanceInterceptor.java:206) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:263) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99) [JAWS] at
RE: [JBoss-user] A little BMP philosophy/understanding
In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To:'[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems with Oracle's cursor limit (fixed in 2.1). I'm re-writing the minerva PreparedStatement caching so it handles cursor limit better. I'll submit the code tomorrow after I test it. Bill ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] JDBCRealm , please help
I got it working over JBoss 2.1, Tomcat 3.2 and Postgres. 1)Edit the server.xml 2)Uncomment the JDBCRealm: RequestInterceptor className="org.apache.tomcat.request.JDBCRealm" debug="99" driverName="org.postgresql.Driver" connectionURL="jdbc:postgresql:dbName" connectionName="userid" connectionPassword="password" userTable="users" userNameCol="uid" userCredCol="password" userRoleTable="user_roles" roleNameCol="role_name" / 3)Make sure you comment any other Realm, like SimpleRealm...and so on. To avoid conflict. 4)Define security in your web.xml 5) restart JBoss Alvin joel cordonnier wrote: Hi all, Does anyone have tried using JDBCRealm for security? I am using Jboss Pre-2.1, embedded tomcat I will to configure JBOSS to use Oracle 8i: I must absolutely configure the JBoss Autentication ? Is there some HOW TO , or samples? Thanks Joel ___ Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, Yahoo! Messenger : http://fr.messenger.yahoo.com ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] A little BMP philosophy/understanding
So, the caching of the PreparedStatement is stored inthe database connectioncontext and is not shared between the database connection. I am thinking a work around way and it may solve the caching issue.If we have the "named connection" from the pool with the lifecyclye control to release the PreparedStatement from the applicaiton which invoke the container specific API, it probably can solve the problem. - Mike Jau -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 22, 2001 1:25 PMTo: [EMAIL PROTECTED]Subject: RE: [JBoss-user] A little BMP philosophy/understandingIn the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understandingCould you give me some background information about the Preparedstaementcaching on the EJB container side?Since the connection get from pool need to return to pool once thetransaction done. I assumed that the resouce associate to this connectionshould be released and the released resoure include the preparedstatement.Later on, the create preparedstatement will be invoked again from differentconnection. How the preparedstatement cached is my question? - Mike-Original Message-From: Bill Burke [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 22, 2001 12:10 PMTo: [EMAIL PROTECTED]Subject: Re: [JBoss-user] A little BMP philosophy/understandingDan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cachethe PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessingthat interception doesn't happen for the setEntityContext() method andtherefore you actually create a PreparedStatement rather than receiving one fromthe pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviourwouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the sourceand see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems with Oracle's cursor limit (fixed in 2.1).I'm re-writing the minerva PreparedStatement caching so it handles cursor limit better. I'll submit the code tomorrow after I test it.Bill___JBoss-user mailing list[EMAIL PROTECTED]http://lists.sourceforge.net/lists/listinfo/jboss-user___JBoss-user mailing list[EMAIL PROTECTED]http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] JBoss and Java Web Start
Hi, I think you need to set the option -Djavax.naming.initialcontext to the class that implements the initialcontext (f.e. javax.naming.InitialContext). I'm not sure I typed the right option name, so check the JNDI spec for this. Do you like Web Start? Michel de Groot Hi ! We are trying to get a client application communicating with JBoss to work with Java Web Start. When creating the InitialContext, javax.naming.NoInitialContextException... (Se stacktrace). When we directly run the application, there is no problem. We tried to unpack the jnp-client and jta-spec files and included them into our own application jar file, and the same error occured ! It really looks like that the file isn't loaded into the Classpath.. but why ? Anyone having any ideas ? Regards // Johan ** System configuration Win2k JDK1.3 JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). ** The files that are included in the client classpath jboss-client.jar ejb.jar jnp-client.jar jta-spec1_0_1.jar ** Code for creating the InitialContext ... Properties contextProps = new Properties(); contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingC ontextFactory"); contextProps.put("java.naming.factory.url.pkgs", "org.jboss.naming"); if (System.getProperty(Context.PROVIDER_URL) == null) { contextProps.put(Context.PROVIDER_URL, "localhost"); } iContext = new InitialContext( contextProps ); Exception is thrown ... ** Stack trace javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) 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 se.speakup.kvalitid.jndi.InitialContextFactory.getInitialContext(InitialCont extFactory.java:44) johan.nordin SpeakUp DevCon AB Nygatan 3, 803 20 Gvle Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 Mobile +46-(0)70-778 17 70 E-mail [EMAIL PROTECTED], Web www.speakup.se ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JBoss and Java Web Start
Hi, There is a known problem with 1.0 FCS Java Web Start: it does not set the context class loader on the event dispatch thread. When you create the InitialContext in the main thread it should find the classes. I hope this helps. Wim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Johan Nordin Sent: donderdag 22 maart 2001 13:01 To: [EMAIL PROTECTED] Subject: [JBoss-user] JBoss and Java Web Start Hi ! We are trying to get a client application communicating with JBoss to work with Java Web Start. When creating the InitialContext, javax.naming.NoInitialContextException... (Se stacktrace). When we directly run the application, there is no problem. We tried to unpack the jnp-client and jta-spec files and included them into our own application jar file, and the same error occured ! It really looks like that the file isn't loaded into the Classpath.. but why ? Anyone having any ideas ? Regards // Johan ** System configuration Win2k JDK1.3 JBoss 2.0 FINAL and JBoss 2.1 (Tried it both, same problem). ** The files that are included in the client classpath jboss-client.jar ejb.jar jnp-client.jar jta-spec1_0_1.jar ** Code for creating the InitialContext ... Properties contextProps = new Properties(); contextProps.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingC ontextFactory"); contextProps.put("java.naming.factory.url.pkgs", "org.jboss.naming"); if (System.getProperty(Context.PROVIDER_URL) == null) { contextProps.put(Context.PROVIDER_URL, "localhost"); } iContext = new InitialContext( contextProps ); Exception is thrown ... ** Stack trace javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) 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 se.speakup.kvalitid.jndi.InitialContextFactory.getInitialContext(InitialCont extFactory.java:44) johan.nordin SpeakUp DevCon AB Nygatan 3, 803 20 Gvle Tel +46-(0)26-600 690, Fax +46-(0)26-600 691 Mobile +46-(0)70-778 17 70 E-mail [EMAIL PROTECTED], Web www.speakup.se ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] UndeclaredThrowableException problems
On Thu, 22 Mar 2001, natxo wrote: Thank you very much, Your advice resolve my problem, but I don't figure out why it doesn't work in the other way. The root of the confution is that in EJBs the bean implementation doesn't directly implement the remote interface. If this were so, your bean wouldn't have compiled. In your remote interface, you said that the 'getMessage' method threw only RemoteException. However, your bean's implementation of 'getMessage' is declared as throwing MessageException. Because of the way the interface is defined, the client side stubs get an exception (through the RMI call) that they don't expect. This causes the UndeclaredThrowableException you've been seeing. At 12:25 22/03/2001 -0600, you wrote: Try Tim Clarke's advice, catch the UndeclaredThrowableException, call getUndeclaredThrowable and print it. This might be more enlightening. Is 'MessageException' an exception of yours? Yes, it is. If so, is it declared as being thrown from your 'getMessage' method in both your bean and the bean's remote interface? yes. My bean 'SimpleEJB': public interface SimpleEJB extends EJBObject { public String getMessage() throws RemoteException, MessageException; } My remote interface 'SimpleEJBBean': public class SimpleEJBBean implements SessionBean { private String sMessage=""; public String getMessage() throws MessageException { this.sMessage = "Hello World!"; System.out.println ("message:"+this.sMessage); throw new MessageException("Hola soc una excepcio"); } ... } Again, thank you very much, Natxo On Thu, 22 Mar 2001, natxo wrote: The stacktrace is below: java.lang.reflect.UndeclaredThrowableException java.lang.reflect.UndeclaredThrowableException: MessageException: Hola soc una excepcio 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.StatelessSessionProxy.invoke(StatelessSessionProxy.java:188) at $Proxy1.getMessage(Unknown Source) at SimpleEJBClient.doGet(SimpleEJBClient.java:100) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) thanks for your interest, Natxo At 11:33 22/03/2001 -0600, you wrote: What's the stack trace you see from your servlet? On Thu, 22 Mar 2001, ncabre wrote: Hi, I''ve read a lot of e-mails with that subject, but I haven't found its solution. I use Tomcat 3.2.1 standalone and JBoss 2.1. with JDK1.3 in windows 2000. My problem is when i launch an exception from EJB, which isn't caught in my client (servlet). I tried a lot of combinations around CLASSPATH, WEB-INF/lib, .. but any of them was correct. Has anybody found a solution about this problem? thanks in advance, Natxo ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL
RE: [JBoss-user] EJB concurrency
quickly.. no the pool size is something else. The concurency in threads is disconnected. We do thread "concurency management" in the container stacks based on use and tx association. Only when a client is associated with an instance does the thread penetrate it's code. It is true that "# active threads = # *active* instance", but it doesn't limit the number of threads (nothing does) in the core container stacks. Also the container stacks are agnostic when it comes to thread creation, these are created in the invocation layer (that could be done otherwise...) Re: limiting the thread usage. If you use RMI there could be a way to limit the number of threads that the RMI sub-engine starts, i don't know you would have to ask the RMI expert (rickard) I don't even know that the RMI engine re-uses threads... If however (as we would expect) you use apache and tomcat to invoke stuff into the JBoss containers. Then the thread creation rests with Apache and if you have a way to pool the invocations then yes the apache stacks can effectively limit the number of threads going to the container. As a side note, I would say 2 things 1- We did "in-depth" tests with Sebastien on the scalability of the container and the container did behave "linearly" up to 2000 threads (Two thousands) in the container at one time, we would spawn 3000 clients ON A AVERAGE WINDOWS2000 box and it would NOT show real degradation. I don't know that it has changed. I am right now swamped in work as I do 8am-1am on finishing a training but I will get back to that as soon as I can. 2- There is another approach we have been toying with and that is to create "queues" of invocation from which the threads start and go in our container, it does essentially "decouple" the invocation plugins from the container stacks... I am not absolutely convinced that it is a "necessary feature" at this point. I need to think some more and there are so many things that require our attention before that... Tell me again why are we having this discussion? marc |-Original Message- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED]]On Behalf Of Michel |Anke |Sent: Thursday, March 22, 2001 3:19 PM |To: [EMAIL PROTECTED] |Subject: Re: [JBoss-user] EJB concurrency | | |Hmm... maybe some of the pool implementors can answer this one? | | | does the number of pool instances equate to the number of |concurrent uses in | jboss? every "pool" i've worked with removes the object from |the pool once | it's allocated (replacing it if the pool gets too small) and |returns it when | it's available again. that traditional pool functionality helps the | scenario below not at all, since the service is more than |willing to let 10k | concurrent threads grab EJB references while the pool itself |only stuggles | to maintain its minimum count. | | chris | | -Original Message- | From: Michel Anke [mailto:[EMAIL PROTECTED]] | Sent: Wednesday, March 21, 2001 6:04 PM | To: [EMAIL PROTECTED] | Subject: Re: [JBoss-user] EJB concurrency | | Maybe limit the number of pool instances would work? | | Michel de Groot | | Is there a way to limit the number of EJB instances used concurrently? | | An example scenario: | | Two message queues, Q1 and Q2. Two message beans, B1 and B2 handling | messages from their respective queues. B1 receives a message, |processes | it, | and under certain conditions sends a message to Q2. B2 receives a | message, | processes it, and sends multiple messages to Q1. (if this sounds odd, | think | link handling in a web spider) One can easily see how this can quickly | lead | to thread counts and VM sizes growing exponentially, the only |throttling | factor being B1's conditional logic. However, if the number |of concurrent | instances of B2 is limited then this setup can work quite |efficiently. Is | there a way to specify that in deployment? | | chris | | "Technology that remains a tool only for the elite few is a failed | technology." | - Douglas E. Welch | Trawick, James.vcf | | ___ | JBoss-user mailing list | [EMAIL PROTECTED] | http://lists.sourceforge.net/lists/listinfo/jboss-user | | ___ | JBoss-user mailing list | [EMAIL PROTECTED] | http://lists.sourceforge.net/lists/listinfo/jboss-user | | |___ |JBoss-user mailing list |[EMAIL PROTECTED] |http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] A little BMP philosophy/understanding
Hello, I've been trying to follow this interesting discussion, but now I'm lost. Let me explain my confusion: Usually in my BMP business methods I obtain a connection, create prepared statements and close statements and the connection at the very end of the method (assuming that jboss is caching the connection and statements). Is that the right pattern? If not, should I open a connection in ejbCreate/ejbPostCreate/ejbActivate and close it in ejbRemove/ejbPassivate? Will it speed up the things? Thanks in advance for any advice. Alex. Mike Jau wrote: So, the caching of the PreparedStatement is stored in the database connection context and is not shared between the database connection. I am thinking a work around way and it may solve the caching issue. If we have the "named connection" from the pool with the lifecyclye control to release the PreparedStatement from the applicaiton which invoke the container specific API, it probably can solve the problem. - Mike Jau -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by:To: [EMAIL PROTECTED] "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] 03/22/2001 12:42 PM cc: Please respond to jboss-userSubject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a
RE: [JBoss-user] A little BMP philosophy/understanding
you should close the statements and connections. the code for using a connection pool should be the same as if you were not using a connection pool. ie transparent. when using a connection pool the con.close() call is an indicator for the pool that you are done with the connection and it is now available to other threads. If not, should I open a connection in ejbCreate/ejbPostCreate/ejbActivate and close it in ejbRemove/ejbPassivate? Will it speed up the things? this way you are going to run out of connections really fast and your system will not scale. because eventually the pool will be empty. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alexander Kogan Sent: Thursday, March 22, 2001 1:23 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Hello, I've been trying to follow this interesting discussion, but now I'm lost. Let me explain my confusion: Usually in my BMP business methods I obtain a connection, create prepared statements and close statements and the connection at the very end of the method (assuming that jboss is caching the connection and statements). Is that the right pattern? Thanks in advance for any advice. Alex. Mike Jau wrote: So, the caching of the PreparedStatement is stored in the database connection context and is not shared between the database connection. I am thinking a work around way and it may solve the caching issue. If we have the "named connection" from the pool with the lifecyclye control to release the PreparedStatement from the applicaiton which invoke the container specific API, it probably can solve the problem. - Mike Jau -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by:To: [EMAIL PROTECTED] "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] 03/22/2001 12:42 PM cc: Please respond to jboss-userSubject: RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that
Re: [JBoss-user] A little BMP philosophy/understanding
On Thu, 22 Mar 2001, Alexander Kogan wrote: Hello, I've been trying to follow this interesting discussion, but now I'm lost. Let me explain my confusion: Usually in my BMP business methods I obtain a connection, create prepared statements and close statements and the connection at the very end of the method (assuming that jboss is caching the connection and statements). Is that the right pattern? Usually this is done in ejbCreate, ejbFindByXXX, ejbLoad and ejbStore. Of course if your business methods are doing additional database access, that's how to do it. The point is that you should obtain and close the connection in the same method (just as you are). We've since gotten into a bit of a tangent about how JBoss is optimizing things under the covers. If not, should I open a connection in ejbCreate/ejbPostCreate/ejbActivate and close it in ejbRemove/ejbPassivate? Will it speed up the things? Thanks in advance for any advice. Alex. Mike Jau wrote: So, the caching of the PreparedStatement is stored in the database connection context and is not shared between the database connection. I am thinking a work around way and it may solve the caching issue. If we have the "named connection" from the pool with the lifecyclye control to release the PreparedStatement from the applicaiton which invoke the container specific API, it probably can solve the problem. - Mike Jau -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by:To: [EMAIL PROTECTED] "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] 03/22/2001 12:42 PM cc: Please respond to jboss-userSubject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than
RE: [JBoss-user] A little BMP philosophy/understanding
Doesn't this defeat the purpose of caching and prepared statements? If you close the prepared statement then the db connection goes away right? So why used a prepared statmenet at all, beacuse it is never really prepared? It seems to me the cache would need to keep at least one of each prepared statement used to be of any value. no, you should not cache statements. If you are using prepared statements, it is on the level of the driver to make sure that they are cached. a prepared statement should give you the same performance even if you close them in your code, since it is handled by the driver, not by the programmer, or by jboss. caching statements goes back to 1997 when the drivers did not do this for you. now a days, almost all of them do. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Hansen, Richard Sent: Thursday, March 22, 2001 1:53 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] A little BMP philosophy/understanding Rick Hansen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To:"'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time. On the other hand, I'd have thought that PreparedStatements would be far less costly to manufacture than Connections, and therefore not worth the overhead of managing a pool. I think I'll poke my nose into the source and see what's there. There's often communication with the database to create the PreparedStatement. That way it can pre-compile a query plan. There is a prepared statement cache in JBoss: in JBoss 2.0, it caused problems
RE: [JBoss-user] A little BMP philosophy/understanding
It seems that the JBOSS EJB container do need to implement the connection pooling and preparedstatement caching just because the JDBC driver already support them. Does the JDBC2.x and above support the connection pooling? Is JDBC2.x specification mention about the Preparedstatement caching? - Mike -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 4:04 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding Doesn't this defeat the purpose of caching and prepared statements? If you close the prepared statement then the db connection goes away right? So why used a prepared statmenet at all, beacuse it is never really prepared? It seems to me the cache would need to keep at least one of each prepared statement used to be of any value. no, you should not cache statements. If you are using prepared statements, it is on the level of the driver to make sure that they are cached. a prepared statement should give you the same performance even if you close them in your code, since it is handled by the driver, not by the programmer, or by jboss. caching statements goes back to 1997 when the drivers did not do this for you. now a days, almost all of them do. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Hansen, Richard Sent: Thursday, March 22, 2001 1:53 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] A little BMP philosophy/understanding Rick Hansen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To:"'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so
Re: [JBoss-user] A little BMP philosophy/understanding
Hey all, - I sent an e-mail detailing how to shut off PreparedStatement caching in JBoss 2.0-Final. Please see the archives if you're interested. It will work for JBoss 2.1 as well(minerva beta3?) - I am re-writing the PreparedStatement caching for minerva. Who maintains minerva and where is the CVS for it so I can submit it to them? Is Aaron Mulder the culprit? Bill Filip Hanik wrote: Doesn't this defeat the purpose of caching and prepared statements? If you close the prepared statement then the db connection goes away right? So why used a prepared statmenet at all, beacuse it is never really prepared? It seems to me the cache would need to keep at least one of each prepared statement used to be of any value. no, you should not cache statements. If you are using prepared statements, it is on the level of the driver to make sure that they are cached. a prepared statement should give you the same performance even if you close them in your code, since it is handled by the driver, not by the programmer, or by jboss. caching statements goes back to 1997 when the drivers did not do this for you. now a days, almost all of them do. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Hansen, Richard Sent: Thursday, March 22, 2001 1:53 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] A little BMP philosophy/understanding Rick Hansen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To:"'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the create preparedstatement will be invoked again from different connection. How the preparedstatement cached is my question? - Mike -Original Message- From: Bill Burke [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] A little BMP philosophy/understanding Dan Christopherson wrote: On Fri, 23 Mar 2001, Peter Routtier-Wone wrote: Someone from this discussion group indicate that container might cache the PreparedStatement. I can't speak with authority on this, but that rings true. I'm guessing that interception doesn't happen for the setEntityContext() method and therefore you actually create a PreparedStatement rather than receiving one from the pool. Just for kicks, I gave it a try but transactions weren't completed and they'd just hang out there forever, blocking every other persistence and finder method until they timed out. That would bollox lifecycle management, and the described behaviour wouldn't be at all surprising. This is also a common bean bug: 'close()' should be called on every resultset, statement, and connection in a finally clause so that you know it happens every time.
RE: [JBoss-dev] Re: [JBoss-user] A little BMP philosophy/understanding
oops, we are cross posting, no good, sorry about that. I'm re-writing the PreparedStatement cache - so that it is configurable from jboss.jcml. I can no way right now other than changing the source directly of configuring the PS cache size. - so that connections watch all open cursors that are created(Statements and PreparedStatements). Basically if you have 50 PreparedStatements cached, your max open cursors is 50, and you want to createStatement, I'm making the connection release one of the cached PreparedStatement so that the new createStatement won't fail. remember that during a transaction, the connection (JDBC 1) used gets associated with the transaction context. hence, other transactions/threads will not be accessing the connection during that time since they are not involved in this DB transaction. why would you want to keep the cursors open. once you retrieved your resultset, your are done with the cursor and should close it. the prepared statement is nothing but precompiled (during runtime) SQL, and if the connection should keep this precompiled statement alive on the database, not through the PreparedStatement reference that the programmer holds in his code. can somebody please tell *ME* to shut up, if I am completely off balance here :) Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Burke Sent: Thursday, March 22, 2001 2:57 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [JBoss-dev] Re: [JBoss-user] A little BMP philosophy/understanding In JBoss 2.1 (minerva beta3?) the PreparedStatement cache does have a limit. Also, when the cache reaches it's limit, it removes the least recently used PS and closes it. - Is it useful to block if the max open cursors have been reached when creating a new Statement or PreparedStatement? This would only be useful if more the one thread had access to the connection, but does that ever happen, and is it allowed to happen? Bill Mike Jau wrote: So, the caching of the PreparedStatement is stored in the database connection context and is not shared between the database connection. I am thinking a work around way and it may solve the caching issue. If we have the "named connection" from the pool with the lifecyclye control to release the PreparedStatement from the applicaiton which invoke the container specific API, it probably can solve the problem. - Mike Jau -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 1:25 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] A little BMP philosophy/understanding In the original JBoss 2.0 version the PreparedStatement cache was not discarded after the connection was returned to the pool because more than likely you might want to issue that one of these PreparedStatements again. To make matters worse there wasn't an upper limit on the number of PreparedStatement objects in the cache so things would continue to grow as you prepared new SQL statements. If you happened to prepare the same exact SQL statement then you received the previously cached PreparedStatement object but otherwise you got a new PreparedStatement that was also added to the cache. This would continue until either a) the database complained or b) you ran out of memory which ever came first. On Oracle, for example, each PreparedStatement takes memory on the database and once you hit 100 or so the database throws an exception when you try to get another one. I patched the code by releasing the PreparedStatement cache when the Connection was released and submitted that fix but I'm not sure it was accepted. What really needs to happen is that the PreparedStatement cache needs to be enhanced so that an upper bound can be established via a configuration variable so that after x PreparedStatements have been cached new PreparedStatements will push one of the old ones out of the cache. - Jon Harvie Mike Jau [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/22/2001 12:42 PM Please respond to jboss-user To:"'[EMAIL PROTECTED]'" [EMAIL PROTECTED] cc: Subject:RE: [JBoss-user] A little BMP philosophy/understanding Could you give me some background information about the Preparedstaement caching on the EJB container side? Since the connection get from pool need to return to pool once the transaction done. I assumed that the resouce associate to this connection should be released and the released resoure include the preparedstatement. Later on, the
Re: [JBoss-user] A little BMP philosophy/understanding - Thanks!
Filip, Dan, everyone who responded to me! Thanks a lot, guys for your time and knowledge. Best regards, Alexander Kogan wrote: Hello, I've been trying to follow this interesting discussion, but now I'm lost. Let me explain my confusion: Usually in my BMP business methods I obtain a connection, create prepared statements and close statements and the connection at the very end of the method (assuming that jboss is caching the connection and statements). Is that the right pattern? If not, should I open a connection in ejbCreate/ejbPostCreate/ejbActivate and close it in ejbRemove/ejbPassivate? Will it speed up the things? Thanks in advance for any advice. Alex. -- __ Alexander Kogan PTC www.ptc.com [EMAIL PROTECTED]140 Kendrick St. Needham MA 02494 ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] NoClassDefFoundError: org/jboss/security/SecurityAssociation
Your missing the jbosssx-client.jar from your classpath. Its in the jboss dist client directory. - Original Message - From: Andrew Tan To: [EMAIL PROTECTED] Sent: Friday, March 23, 2001 10:37 AM Subject: [JBoss-user] NoClassDefFoundError: org/jboss/security/SecurityAssociation Hi, I have a problem when I tried to run a client to access the EJB. It managed to get a reference to this EJB object, but when it tried called home.create() this error came up. I am using: Jboss2.1 Windows 2000 JDK1.3 If anyone can help me solve it problem, I would be grateful. Regards, Andrew T. --- The error looks like this: Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/SecurityAssociation at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.getPrincipal(GenericProxy.java:184) at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:231) at $Proxy0.create(Unknown Source) at InterestClient.main(InterestClient.java:51) line 51 is --- Interest interest = home.create(); // where Interest is the EJB Bean ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JBoss and Java Web Start
Hello, On Thu, 22 Mar 2001, Johan Nordin wrote: Hi, I just fixed the problem, it was not a JBoss problem (of course) =) It's a bugg in JWS, JWS does something wrong with the classloaders. Before creating any InitialContext, this code snipped must be included: (Found it on the discussion forum for JWS, http://forum.java.sun.com/read/56761/qAWFW4miqiQgAAY-i#LR).) try { final ClassLoader jnlpCL = this.getClass().getClassLoader(); java.awt.EventQueue eq = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); eq.invokeAndWait(new Runnable() { public void run() { Thread.currentThread().setContextClassLoader(jnlpCL); } }); } catch (Exception e) { } well - it is a jboss problem, jboss is not supplying bytecode for home and remote interfaces at it's codebase (Webserver MBean) ... or for any other class that is in .jars of deployed EJBs (please, correct me if i'm wrong!) ... the possible problem with that would be when implementation of interface as result of EJB methods are returned, one such situation would be: interface that is returned: public interface Test extends java.io.Serializable { public String getName(); } remote interface for ejb: public interface Bean extends EJBObject { Test getTest() throws RemoteException; } bean class: public class BeanBean implements SessionBean { ... public Test getTest() { return new TestImpl(); } ... public static class TestImpl implements Test { public String getName() {return "just a test";} } } in this case remote user must have BeanBean.TestImpl in its classpath and that means that each change of Test implementation makes recompile of client code necessary - if client could obtain bytecode from codebase via RMIClassLoader recompile of it's code after change of Test Implementation would be unnecessary ... Dragan ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] How do i unsubscribe this emails..
plz let me know!!! How do i unsubscribe this emails..
Re: [JBoss-user] A little BMP philosophy/understanding
Dan, what did you mean by "this" in the statement "Usually this is done in ejbCreate..."? - Original Message - From: "Dan Christopherson" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 22, 2001 4:52 PM Subject: Re: [JBoss-user] A little BMP philosophy/understanding Usually in my BMP business methods I obtain a connection, create prepared statements and close statements and the connection at the very end of the method (assuming that jboss is caching the connection and statements). Is that the right pattern? Usually this is done in ejbCreate, ejbFindByXXX, ejbLoad and ejbStore. Of course if your business methods are doing additional database access, that's how to do it. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JBoss Embedded Tomcat error
Hello, I am having problem running JBoss with embedded Tomcat. Here is what happens when I start JBoss. Can somebody help? or Can somebody send me a working jboss.conf, jboss.jcml and (Tomcat) server.xml files. Thanks Rajeevan [EmbeddedTomcat] Starting [EmbeddedTomcat] Starting EmbeddedTomcat ... [EmbeddedTomcat]ERROR reading /usr/local/tomcat/conf/server.xml [EmbeddedTomcat]AT Line 133 /Server/ContextManager/ContextInterceptor/ className=org.jboss.tomcat.ContextClassLoaderInterceptor [EmbeddedTomcat]Fatal configuration error [EmbeddedTomcat]java.lang.ClassNotFoundException: org.jboss.tomcat.ContextClassLoaderInterceptor ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] FYI: OracleXADataSource HOWTO
Seems like a lot of people are asking questions about how to use this. mbean code="org.jboss.jdbc.RawXADataSourceLoader" name="DefaultDomain:service=XADataSource,name=oraclePool" attribute name="PoolName"oraclePool/attribute attribute name="DataSourceClass"oracle.jdbc.xa.client.OracleXADataSource/attribute attribute name="Properties"URL=jdbc:oracle:thin:[EMAIL PROTECTED]:1521:dbname/attribute /mbean Should work fine. BIll ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] NoClassDefFoundError: org/jboss/security/SecurityAssociation
You need to have jboss_jaas.jar in your client's classpath. Regards, Bill Andrew Tan wrote: Hi, I have a problem when I tried to run a client to access the EJB. It managed to get a reference to this EJB object, but when it tried called home.create() this error came up. I am using: Jboss2.1 Windows 2000 JDK1.3 If anyone can help me solve it problem, I would be grateful. Regards, Andrew T. --- The error looks like this: Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/security/SecurityAssociation at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.getPrincipal(GenericProxy.java:184) at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:231) at $Proxy0.create(Unknown Source) at InterestClient.main(InterestClient.java:51) line 51 is --- Interest interest = home.create(); // where Interest is the EJB Bean ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss-user]
Hi, Can we use entity beans with SQL server or mySQL ? Thanks. Wei(new to EJB/JBoss) __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user