[JBoss-user] Servlet API weirdness
I recently moved a servlet .war file from Tomcat 4.0.1 to JBoss 3.0.2/Jetty. This caused the application to break, mainly because HttpServletRequest.getServletPath() seems to be returning the wrong information. When I invoke my servlet with the URL http://localhost:8080/pending/servlet/pending/login on the two platforms, I get the following from the HttpServletRequest object Tomcat 4: ContextPath: /pending PathInfo: /login QueryString: null RequestURI: /pending/servlet/pending/login ServletPath: /servlet/pending JBoss/Jetty: ContextPath: /pending PathInfo: /pending/login QueryString: null RequestURI: /pending/servlet/pending/login ServletPath: /servlet Judging by the Servlets 2.3 APIdocs, it seems to me like Jetty has a bug with getPathInfo() and getServletPath(), and that Tomcat has it right. Is this a known issue with Jetty? I've posted this query to the JBoss forums in addition to posting here. Thanks, Eric --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Using Castor and JBoss 3.0
I am having trouble trying to get information on how to use Castor in JBoss 3.0. The JBoss/CastorJDO page on the jboss.org site is a bit confusing. It says to download a zip file (that it links to), and extract the castor and xerces jars from taht file. But hte link just points to a jar. Then it points to the plugin to use with JBoss 3.0, but the link is a broken link. I noticed that jboss comes with a castor.jar file, so I am wondering if the docs are out of date and it is built in or something. Anyway, I someone could point me to some info on using JBoss 3.0 and Castor together I would greatly appreciate it. Thanks, -- Eric Anderson CorData Inc. M: 404-293-6124 ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Redeployment problems
I am currently just working on a test app to experiment with JBoss. This test app is an ear file that consists of: A ejb bean which is the interest example from the online manual. The following is the ejb-jar.xml file for that ejb jar that contains the bean: ejb-jar descriptionInterest Example/description display-nameInterest EJB/display-name enterprise-beans session ejb-nameInterest/ejb-name homenet.cordata.HelloWorld.ejb.InterestHome/home remotenet.cordata.HelloWorld.ejb.Interest/remote ejb-classnet.cordata.HelloWorld.ejb.InterestBean/ejb-class session-typeStateless/session-type transaction-typeBean/transaction-type /session /enterprise-beans /ejb-jar If you note I ahve moved the example bean to a different package, and it's name is simply Interest not interest/Interest (trying to keep things simple). This file is placed in the META-INF dir of my ejb.jar file. I then have a war file that consists of a simple jsp page that calls this bean. It is as follows: %@ page import=javax.naming.InitialContext % %@ page import=javax.rmi.PortableRemoteObject % %@ page import=net.cordata.HelloWorld.ejb.Interest % %@ page import=net.cordata.HelloWorld.ejb.InterestHome % html head title Testing JSP /title /head body % try { InitialContext jndiContext = new InitialContext(); Object ref = jndiContext.lookup(Interest); InterestHome home = (InterestHome) PortableRemoteObject.narrow(ref, InterestHome.class); Interest interest = home.create(); out.println(interest.calculateCompoundInterest(1000, 0.10,2)); } catch (Exception e) { out.println( e.toString() ); } % /body /html If I run this JSP page it works great, but if I simply redeploy the ear file (by either copying over the old one or by removing the old first then adding the new without actually changing anything in the content of the ear) then I can a CastException on the call to try to narrow the remote object. I am guessing something is not getting reset correctly when the ear is undeployed, but I am unsure of what I am doing wrong that would be causing this. If you need any more info about this test app (or simply a tar.gz of the entire app) please feel free to ask. Thanks for any help that you can provide -- Eric Anderson CorData Inc. M: 404-293-6124 ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Error when attempting a hello world example
Hi, I am new to J2EE and JBoss. I am attempting to write a simple hello world example to try and get thing up an running. The problem I am getting is that I get a message back that says that it can't find the servlet that I am trying to load. I have a simple servlet class that prints out Hello World. The source to it is as follows: package net.cordata.HelloWorld.web; import java.io.IOException; import javax.servlet.ServletOutputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { res.setContentType(text/plain); ServletOutputStream out = res.getOutputStream(); out.println(Hello World!); } } I have this place in a WAR file under /WEB-INF/classes/net/cordata/HelloWorld/web, and have the following web.xml file in my /WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameHello World/display-name description Testing using hello world to get servlets working, and to get directory strucuture setup, and to get template build system. /description context-param param-namewebmaster/param-name param-value[EMAIL PROTECTED]/param-value description The webmaster of the app /description /context-param servlet servlet-nameHelloWorld/servlet-name servlet-classnet.cordata.HelloWorld.web.HelloWorld/servlet-class /servlet servlet-mapping servlet-nameHelloWorld/servlet-name url-pattern/helloworld/url-pattern /servlet-mapping session-config session-timeout30/session-timeout!-- 30 minutes -- /session-config /web-app Finally I have the WAR file placed in a EAR file which has a application.xml file in META-INF as follows: application display-nameHello World/display-name descriptionAn example application/description module web web-uriHelloWorld.war/web-uri context-root/helloworld/context-root /web /module /application The when I load up http://myhost:8080/helloworld/helloworld I get a message stating that it could not find class: net.cordata.HelloWorld.web.HelloWorld I have searched everywhere I can think of and tried all sorts of variations, but no luck. If I am doing something stupid because I am new at this I would greatly appreciate someone pointing out to me what. Thanks, -- Eric Anderson CorData Inc. ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Error when attempting a hello world example
Nevermind. I just realized that my build system was putting the classes in a directory under teh root fo the war file instead of under the WEB-INF directory. Sorry for the trouble. On Mon, 2002-06-03 at 15:06, Eric Anderson wrote: Hi, I am new to J2EE and JBoss. I am attempting to write a simple hello world example to try and get thing up an running. The problem I am getting is that I get a message back that says that it can't find the servlet that I am trying to load. I have a simple servlet class that prints out Hello World. The source to it is as follows: package net.cordata.HelloWorld.web; import java.io.IOException; import javax.servlet.ServletOutputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { res.setContentType(text/plain); ServletOutputStream out = res.getOutputStream(); out.println(Hello World!); } } I have this place in a WAR file under /WEB-INF/classes/net/cordata/HelloWorld/web, and have the following web.xml file in my /WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameHello World/display-name description Testing using hello world to get servlets working, and to get directory strucuture setup, and to get template build system. /description context-param param-namewebmaster/param-name param-value[EMAIL PROTECTED]/param-value description The webmaster of the app /description /context-param servlet servlet-nameHelloWorld/servlet-name servlet-classnet.cordata.HelloWorld.web.HelloWorld/servlet-class /servlet servlet-mapping servlet-nameHelloWorld/servlet-name url-pattern/helloworld/url-pattern /servlet-mapping session-config session-timeout30/session-timeout!-- 30 minutes -- /session-config /web-app Finally I have the WAR file placed in a EAR file which has a application.xml file in META-INF as follows: application display-nameHello World/display-name descriptionAn example application/description module web web-uriHelloWorld.war/web-uri context-root/helloworld/context-root /web /module /application The when I load up http://myhost:8080/helloworld/helloworld I get a message stating that it could not find class: net.cordata.HelloWorld.web.HelloWorld I have searched everywhere I can think of and tried all sorts of variations, but no luck. If I am doing something stupid because I am new at this I would greatly appreciate someone pointing out to me what. Thanks, -- Eric Anderson CorData Inc. ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user -- Eric Anderson CorData Inc. M: 404-293-6124 ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Interest example question
Hi, I am currently evaluating JBoss to determine if it will fit the needs of our development shop. I am attempting to get the Interest example from the online-book up an running, but am running into issues. I have compiled and deployed the interest bean, but am having problems getting the test client to interact with it properly. It seems to connect to the bean, but it seems to die when it tries to create the Interest object. The following is the backtrace of the output when I run the client. If anybody could point me in the right direction on how to fix this problem I would greatly appreciate it. [eman@appsbuild]$antintro-interest-clientBuildfile:build.xml validate-servlet: validate-jboss: fail_if_not_valid: init:[echo]UsingJBossdirectory=/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/[echo]Usingbaseclasspath=/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/client/jboss-j2ee.jar:/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/client/jaas.jar:/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/client/jbosssx-client.jar:/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/client/jboss-client.jar:/usr/local/jboss-3.0.0RC1_tomcat-4.0.3/client/jnp-client.jar:/usr/local/tomcat/lib/servlet.jar[echo]UsingSourcedirectory=/home/eman/examples[echo]UsingBuilddirectory=/home/eman/examples/build-examples intro-interest-client: compile: interest-client:[java]Gotcontext[java]Gotreference[java]Exceptioninthread"main"java.lang.NoClassDefFoundError:org/jboss/logging/Logger[java]atorg.jboss.invocation.MarshalledValueInputStream.clinit(MarshalledValueInputStream.java:25)[java]atjava.lang.Class.forName0(NativeMethod)[java]atjava.lang.Class.forName(Class.java:115)[java]atorg.jboss.invocation.MarshalledValueOutputStream.class$(MarshalledValueOutputStream.java:23)[java]atorg.jboss.invocation.MarshalledValueOutputStream.clinit(MarshalledValueOutputStream.java:25)[java]atorg.jboss.invocation.MarshalledValue.init(MarshalledValue.java:47)[java]atorg.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:317)[java]atjava.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1167)[java]atjava.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)[java]atsun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:263)[java]atsun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)[java]atorg.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(UnknownSource)[java]atorg.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)[java]atorg.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)[java]atorg.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)[java]atorg.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)[java]atorg.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)[java]atorg.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)[java]at$Proxy0.create(UnknownSource)[java]atorg.jboss.docs.interest.InterestClient.main(InterestClient.java:39)[java]JavaResult:1 BUILDSUCCESSFUL Totaltime:2seconds Thanks, Eric
[JBoss-user] Deploying Jetspeed
I'm running into a problem deploying Jetspeed under both JBoss-Jetty and JBoss-Catalina. The Jetspeed webapp appears to be deploying correctly, but I get Error fetching pane messages in the Jetspeed web UI, and I see the following errors in the Jetspeed logs: [Tue Feb 19 11:19:56 PST 2002] -- ERROR -- Could not unmarshal: /opt/JBoss-2.4.4_Jetty-3.1.3-1/jboss/tmp/deploy/Default/jetspeed.war/web1003/WEB-INF/conf/wml-examples.xreg Exception: org.exolab.castor.mapping.MappingException: Nested error: org.exolab.castor.mapping.MappingException: Could not find the class org.apache.jetspeed.services.registry.RegistryFragment Some research reveals that org.apache.jetspeed.services.registry.RegistryFragment is in fact in the jetspeed-1.3a2-release.jar archive in my JBoss-2.4.4_Jetty-3.1.3-1/jboss/tmp/deploy/Default/jetspeed.war/web1003/WEB-INF/lib directory. So, it looks to me like this is some kind of classpath/classloader problem. Has anyone had this problem and solved it? Any other ideas? I found that I had to copy the castor jar file from Jetspeed into jboss/lib/ext, and that got rid of a few exceptions but I'm still left with the problem above. Thanks, Eric ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Deployment dependencies / timing
I have a question about how to specify or control deployment order in JBoss. I have two EJB jar files, one containing a single MDB, and another containing a collection of session/entity beans that the MDB calls upon. As it so happens, the MDB is deployed ahead of the bean jar file. When I start JBoss, if the MDB queue contains data, then the MDB is called *during* JBoss startup. When this happens, the MDB cannot access the beans from the other jar file, because it has not yet been deployed! I'm wondering if there's a way to either defer MDB processing until all code is deployed, or to specify a relationship between the MDB and the other beans such that the MDB will not be started until those beans are deployed. I think I could make this work if I packaged the MDB+the beans in one jar file (or as components in a .ear file), but I would really prefer not to do that, as the non-MDB beans are a resource that are shared across applications. I'm probably asking a more general J2EE question here, but if it matters, I'm currently using JBoss 2.4.3. Thanks, Eric Anderson ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] CMP getter exception
Hi all, I'm getting a mysterious exception with JBoss 2.4.1a and a fairly simple CMP bean. The bean is called User and references the Users table in an Oracle server. The code that causes the exception looks like this: UserHome uhome = (UserHome)PortableRemoteObject.narrow (ref, UserHome.class); User User1 = uhome.findByPrimaryKey(new Long(1)); System.out.println(User1.getPassword()); The exception is thrown when getPassword() is called. This should return a String, and the corresponding column in the table is of type VARCHAR2(10). Below is the stack trace: [J2EE Deployer Default] J2EE application: file:/opt/JBoss-2.4.1_Tomcat-3.2.3/jboss/deploy/VLBeans.jar is deployed. [JAWS] Exists command executing: SELECT COUNT(*) FROM USERS WHERE objid=? [JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=1 [EntityLockInterceptor] Begin invoke, key=1 [User] Activated bean User with id = 1 [EntityInstanceInterceptor] Begin invoke, key=1 [EntitySynchronizationInterceptor] invoke called for ctx org.jboss.ejb.EntityEnterpriseContext@e344b02, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=catamount.ultracode.com//1, BranchQual=] [JAWS] Load command executing: SELECT USERS.objid,USERS.user_priv_type,USERS.user_id,USERS.password,USERS.first_name,USERS.privilage_allowed,USERS.state,USERS.account_id,USERS.phone,USERS.audio_priv,USERS.qa,USERS.street,USERS.street2,USERS.phoneretrievalpin,USERS.login_allowed,USERS.email,USERS.country,USERS.user_num,USERS.city,USERS.last_name,USERS.zip,USERS.priority,USERS.middle_name,USERS.fax,USERS.phone_lines,USERS.title FROM USERS WHERE objid=? [JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=1 [EntitySynchronizationInterceptor] loadEntity Exception, clear tx for ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=catamount.ultracode.com//1, BranchQual=] [EntityInstanceInterceptor] Ending invoke, exceptionThrown, ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02 [EntityInstanceInterceptor] End invoke, key=1, ctx=org.jboss.ejb.EntityEnterpriseContext@e344b02 [EntityLockInterceptor] End invoke, key=1 [User] TRANSACTION ROLLBACK EXCEPTION:Load failed; nested exception is: java.lang.NullPointerException; nested exception is: java.rmi.ServerException: Load failed; nested exception is: java.lang.NullPointerException [User] java.rmi.ServerException: Load failed; nested exception is: [User] java.lang.NullPointerException [User] java.lang.NullPointerException [User] at java.lang.reflect.Field.set(Native Method) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setCMPFieldValue(JDBCCommand.java:655) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.loadOneEntity(JDBCLoadEntityCommand.java:217) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadEntityCommand.java:176) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleResult(JDBCQueryCommand.java:59) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:160) [User] at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:147) [User] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:156) [User] at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:362) [User] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:286) [User] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:208) [User] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:136) [User] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133) [User] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307) [User] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99) [User] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128) [User] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) [User] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:427) [User] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:393) [User] at java.lang.reflect.Method.invoke(Native Method) [User] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:242) [User] at sun.rmi.transport.Transport$1.run(Transport.java:155) [User] at java.security.AccessController.doPrivileged(Native Method) [User] at sun.rmi.transport.Transport.serviceCall(Transport.java:152) [User] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:462) I was wondering if this might have something to do with there being no VARCHAR2 mapping in standardjaws.xml? Eric Anderson ___ JBoss-user mailing list [EMAIL
[JBoss-user] CMP getter exception
Lennart, You hit the nail on the head, that was *exactly* the problem! Thanks for the quick reply and solution. -Eric From: Lennart Petersson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: SV: [JBoss-user] CMP getter exception Date: Thu, 4 Oct 2001 11:35:24 +0200 The classic one is that your db record contains a null value in one of = its attribute and that your are using a primitive attribute in your = entity bean (int instead of Integer, double instead of Double...). That = would cause a NPE in this case. /Lennart ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Re: BLOB
I've used CMP and BLOBs with JBoss in the past. Declare the bean member variable that will hold your BLOB data as a byte[]. This will get mapped to the jdbc-type of JAVA_OBJECT. Then check (standard)jaws.xml to see that the mapping for this exists. It looks like the mapping below - BLOB(2000) - was taken from the DB2 section of standardjaws.xml. DB2 does not seem to have an arbitrary-sized BLOB type, you have to declare a maximum size for a BLOB in advance. You might want to keep this in mind when choosing a database. Postgres has a BLOB type of unlimited size. My experience doing BLOB inserts with Postgres and DB2 and with JBoss is that it's horribly slow. I believe the database is the problem - DB2 was maybe 25% faster than Postgres but neither was fast enough for high-volume inserts, and this was with fairly small BLOBs - 10k-20k. It's possible that the overall problem was not caused by the databases but by JAWS and/or RMI overhead. One thing I'd like to figure out is how to do these BLOB operations while minimizing memory use at both the client and the server. To make BLOBs work with CMP I've had to buffer the blob in memory as a byte[] member variable, both at the client and in the bean instance. Is there a more efficient way to achieve the same thing? It would be wonderful if you could declare an InputStream member and have the RMI serialization code read from this at the client w/o a lot of in-memory buffering. I know that some JDBC drivers can handle InputStream parameters on PreparedStatements, but JAWS doesn't seem to support this. Regards, Eric Message: 8 Date: Sat, 14 Jul 2001 03:04:25 -0700 (PDT) From: Jason Dillon [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Subject: Re: [JBoss-user] BLOB Reply-To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] It looks like JAWS can persist objects via BLOB... but that is just a simple guess by looking at the standardjaws.xml, it has some lines that look like this: mapping java-typejava.lang.Object/java-type jdbc-typeJAVA_OBJECT/jdbc-type sql-typeBLOB(2000)/sql-type /mapping Which would lead me to believe that you could get JAWS to persist to a record with a BLOB column. I would try it. --jason ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Problem with CMP and DB2
I've recently taken a CMP config that had been working with PostgreSQL and moved it onto a new install of DB2 v7.1 personal edition (Linux). I've managed to get to the point where the JBoss deployment of my beans seems to work (all tables get created), but when I try to create an entity instance and write a row to a table, I get the following exception: javax.ejb.CreateException: Could not create entity:COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001 Turning on JBoss SQL logging, I can see the following going on: [DB2] Pool DB2 [1/1/10] gave out pooled object: org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@5e7e6c6e [JAWS] Exists command executing: SELECT COUNT(*) FROM Message WHERE id=? [JAWS] Set parameter: idx=1, jdbcType=BIGINT, value=993053451052 [JAWS] Create command executing: INSERT INTO Message (folderID,status,size,content,parent_msgID,ownerID,id) VALUES (?,?,?,?,?,?,?) [JAWS] Set parameter: idx=1, jdbcType=INTEGER, value=0 [JAWS] Set parameter: idx=2, jdbcType=INTEGER, value=0 [JAWS] Set parameter: idx=3, jdbcType=BIGINT, value=16990 [JAWS] Set parameter: idx=4, jdbcType=JAVA_OBJECT, value=NULL [JAWS] Set parameter: idx=5, jdbcType=BIGINT, value=0 [JAWS] Set parameter: idx=6, jdbcType=INTEGER, value=0 [JAWS] Set parameter: idx=7, jdbcType=BIGINT, value=993053451052 [JAWS] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001 [JAWS] at java.sql.SQLException.init(SQLException.java:45) [JAWS] at COM.ibm.db2.jdbc.DB2Exception.init(DB2Exception.java:93) [JAWS] at COM.ibm.db2.jdbc.DB2Exception.init(DB2Exception.java:111) [JAWS] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:221) [JAWS] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:377) [JAWS] at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:355) [JAWS] at COM.ibm.db2.jdbc.net.DB2PreparedStatement.executeUpdate(DB2PreparedStatement.java:494) [JAWS] at org.opentools.minerva.jdbc.PreparedStatementInPool.executeUpdate(PreparedStatementInPool.java:82) The structure of my table is as follows: db2 = describe table message Column Type Type name schemaname Length Scale Nulls -- - -- - - FOLDERID SYSIBMINTEGER 4 0 Yes STATUS SYSIBMINTEGER 4 0 Yes SIZE SYSIBMBIGINT8 0 Yes CONTENTSYSIBMBLOB 2000 0 Yes PARENT_MSGID SYSIBMBIGINT8 0 Yes OWNERIDSYSIBMINTEGER 4 0 Yes ID SYSIBMBIGINT8 0 Yes From this information, everything *looks* correct - JAWS is attempting to insert seven parameters, and there are seven columns in the table. All of the datatypes match up. So why would DB2 be complaining about the # of parameters? A different question: the reason I'm looking at DB2 was that PostgreSQL large object operations (inserts in particular) seemed to be terribly slow. Is this a known problem with Postgres? Thanks, Eric ___ 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