From: Ludovic O. <lo...@ci...> - 2001-07-31 06:53:57
|
I'm hitting this strange problem: java.lang.NoSuchMethodError at com.cisco.nm.lorban.servlet.InventoryServlet.doPost(com/cisco/nm/lorban/ser vlet/InventoryServlet.java:95) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:7 97) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Http ConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) InventoryServlet.java:95 corresponds to this line: deviceHome.create(deviceName, snmpRead, snmpWrite); but this constructor have been declared in the DeviceBean class: public DevicePK ejbCreate(String name, String readCommunity, String writeCommunity){ this.id = 0; // PK is managed by DBMS this.name = name; this.readCommunity = readCommunity; this.writeCommunity = writeCommunity; return null; } public void ejbPostCreate(String name, String readCommunity, String writeCommunity){ } and in the DeviceHome class: public Device create(String name, String readCommunity, String writeCommunity) throws CreateException, RemoteException; This bean is mapped to this table in Oracle: DEVICES ------- ID number NAME varchar2(255) READ_COMMUNITY varchar(255) WRITE_COMMUNITY varchar(255) The stuff that is certainly causing the problem is that there is a trigger that automatically sets the primary key of the table when ID is set to 0. This is why I don't include this field in the bean's constructor but I included it in the ejb-jar.xml as a CMP field. Is that bad design or is there a bug somewhere ? What is strange is that I've written a small text client that does this job perfectly. Ludovic |