RE: [JBoss-user] Intrabean Call ?
Thanks to all users. The simular name of context with different types in docu was my problem. Best regards. Thomas --Original Message Text--- From: [EMAIL PROTECTED] Date: Thu, 17 May 2001 16:58:13 +0200 The ctx variable in the documentation example is of javax.naming.Context type, while your ctx is of javax.ejb.SessionContext in the book you should have something like: javax.naming.Context ctx = new javax.naming.InitialContext(...); -Original Message- From: Thomas Gr nert [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 17. Mai 2001 16:30 To: [EMAIL PROTECTED] Subject: [JBoss-user] Intrabean Call ? Hi, documentation says: public class ABean implements EntityBean { ... public void BusinessMethod(...) { ... BHome home = (BHome)ctx.lookup("java:comp/env/ejb/myBean"); B bean = home.create(pk); ... } } My inside a SessionBean code looks like: private SessionContext ctx; public void setSessionContext(SessionContext sc) { this.ctx = sc; } public DocumentFragment getMassnahmeByID(long ID) throws RemoteException { MassnahmeHome m_home = (MassnahmeHome)ctx.lookup("java:comp/env/entity/katalog/Massnahme"); SessionContext.getEJBObject(). Compiler says: cannot resolv symbol: mothod lookup I am sure that I do something really wrong. Please help me ! Thomas
[JBoss-user] Intrabean Call ?
Hi, documentation says: public class ABean implements EntityBean { ... public void BusinessMethod(...) { ... BHome home = (BHome)ctx.lookup("java:comp/env/ejb/myBean"); B bean = home.create(pk); ... } } My inside a SessionBean code looks like: private SessionContext ctx; public void setSessionContext(SessionContext sc) { this.ctx = sc; } public DocumentFragment getMassnahmeByID(long ID) throws RemoteException { MassnahmeHome m_home = (MassnahmeHome)ctx.lookup("java:comp/env/entity/katalog/Massnahme"); SessionContext.getEJBObject(). Compiler says: cannot resolv symbol: mothod lookup I am sure that I do something really wrong. Please help me ! Thomas
[JBoss-user] How To JBoss 2.1.1, Interbase 6.01, JDK1.3 on Suse Linux 7.0
Hi, this mail will report, how to install Jboss with interbase from borland as backend on a suse 7.0 system. I write this because it takes 7 days of my small time budget. It was realy crazy. No one should never take the same hard way of mistakes. 1. Install Interbase from www.interbase.com. Unpack and run, there is no problem. Attention on the first gsec call. gsec -user SYSDBA -password changeme (different to windows, where the password is "masterkey") Create a database. See Doku. 2. You need an JDBC driver. OK, no prblem. But I found no hint about the interserver mistery. This file MUST run to connect JDBC and ibserver (Note: ibserver and interserver are not the same !) Second problem: the interserver from from Borland will not run on Suse Linux 7.0 because a libary is missing. No way there. Solution: Take interserver from firebird. How to get sources from this ? Read http://firebird.sourceforge.net. Now you have to compile this stuff under interclient/20/dev/interserver with make. If will not have egcs installed. But there is a work around: patch makefile: #CC=gcc #For linux LINUX_CC=gcc # - set this to gcc as your comiler CC=$(LINUX_CC) Now you will run against this error: gcc -w -fhandle-exceptions -DUSE_INETD -DUNIX -DARCH_32 -I/usr/interbase/include -c NetTCP.cpp -o NetTCP.o NetTCP.cpp: In function `static int NetTCP::netOpen(int, int *, int)': NetTCP.cpp:176: passing `int *' as argument 3 of `accept(int, sockaddr *, socklen_t *)' changes signedness make: *** [NetTCP.o] Error 1 So you can patch the NetTCP.cpp file: again: clilen = sizeof (tcpCliAddr); //tmpSockfd = accept (sockfd, (struct sockaddr *) &tcpCliAddr, &clilen); tmpSockfd = accept (sockfd, (struct sockaddr *) &tcpCliAddr, (unsigned int *) &clilen); //MW: cast to (unsigned int *) added to make it work with gcc ^^ if (tmpSockfd < 0) { if (errno == EINTR) { errno = 0; goto again; /* probably a SIGCLD that was caught */ } Error::err_sys ("accept error"); } Now it comiles and you can bind it to your inetd. Great think, your first connect via JDBC to interbase should be possible. 3. But may you have an getMetaData problem. A special interclient.jar should help. Thanks to David Jenks. I am not sure about his modifications to this driver. 4. So, Jboss start with this and create a XADataSource on startup. If you try to deploy your entity-Bean an other problem follows. can t create PreparedStatement. Don t give up at this point ! Get via CVS the latest JBoss. I think, it is a Minerva bug. Forgett all about jetty or tomcat in your test installation. Try the default one. Add the XADatasource with contribution to new minerava under the jboss path. This looks like somehow like this: org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,interbase.interclient.Driver org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl InterBaseDS jdbc:interbase://host.lan/opt/interbase/db/db.gdb x 5. Now run your new jboss and party ! Special thanks to David Jenks, who helped me more than one time. Good luck for jboss project, one of the coolest server s I know. We use it in combination with cocoon, xerces, JServ and Interbase. It is a dream team. Thomas ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Create entity Bean ->Unable to create PreparedStatement!
Hi, I try to insert a entity into database interbase 6 with interserver 2.0 from firebird (special thanxs to David) and got this log output [JAWS] Create, id is 42 [JAWS] Exists command executing: SELECT COUNT(*) FROM Katalog_Massnahme WHERE ID=? [JAWS] java.sql.SQLException: Unable to create PreparedStatement! [JAWS] at org.opentools.minerva.jdbc.xa.wrapper.XAClientConnection.prepareStatement(XAClientConnection.java:169) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:158) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCBeanExistsCommand.execute(JDBCBeanExistsCommand.java:46) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:126) [JAWS] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createEntity(JAWSPersistenceManager.java:122) [JAWS] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.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(EntityContainer.java:639) [JAWS] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:160) [JAWS] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:87) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:164) [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(JRMPContainerInvoker.java:369) [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) [JAWS] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443) [JAWS] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643) [JAWS] at java.lang.Thread.run(Thread.java:484) Prepared statment with a JDBC-only test tool is running. What can goes wrong here ? Help needed. Thomas ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Help Required: Integrating Interbase 6
Hi, I try to run jboss, jetty (the default package) with interbase. The Driver is loaded [JDBC provider] Initializing [JDBC provider] Loaded JDBC-driver:interbase.interclient.Driver [JDBC provider] Initialized [DefaultDS] Initializing [DefaultDS] Initialized and then the Exception at starting Jboss. [DefaultDS] Starting [DefaultDS] XA Connection pool DefaultDS bound to java:/DefaultDS [Service Control] Could not start DefaultDomain:service=XADataSource,name=DefaultDS [Service Control] java.lang.VerifyError: (class: interbase/interclient/ErrorKey, method: _$372 signature: (Ljava/lang/String;Ljava/lang/String;I)V) Expecting to find unitialized object on stack [Service Control] at interbase.interclient.Driver.connect(Driver.java:180) [Service Control] at java.sql.DriverManager.getConnection(DriverManager.java:517) [Service Control] at java.sql.DriverManager.getConnection(DriverManager.java:177) [Service Control] at org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl.getXAConnection(XADataSourceImpl.java:118) [Service Control] at org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl.getXAConnection(XADataSourceImpl.java:151) [Service Control] at org.opentools.minerva.jdbc.xa.XAConnectionFactory.createObject(XAConnectionFactory.java:246) [Service Control] at org.opentools.minerva.pool.ObjectPool.createNewObject(ObjectPool.java:819) [Service Control] at org.opentools.minerva.pool.ObjectPool.getObject(ObjectPool.java:569) [Service Control] at org.opentools.minerva.pool.ObjectPool.getObject(ObjectPool.java:521) [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.(Main.java:203) [Service Control] at org.jboss.Main$1.run(Main.java:107) [Service Control] at java.security.AccessController.doPrivileged(Native Method) [Service Control] at org.jboss.Main.main(Main.java:103) what s going wrong there. Please, can sombody help me ! my configfile jboss.jcml bute> interbase.interclient.Driver DefaultDS org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl user=evermind;password=evermind jdbc:interbase://pluto.lan//opt/interbase/db/altbau_katalog.gdb 120 10 false false false true 12 180 false false 1.0 0 Greeting and very much thank you to all the list users, who are helped me until yet. Thomas ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user