aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2 + Sql Server 2000 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 2 + Sql Server 2000" Watch "EJB 2 + Sql Server 2000" New topic
Author

EJB 2 + Sql Server 2000

Srihari Murali
Greenhorn

Joined: Oct 28, 2006
Posts: 4
Hi

I am new to j2ee and am trying to develop a simple online bankin app. Frontend: JSP; Backend: Sql Server 2000. Have a dB and datasourcename ready. When i try to access the dB via a CMP Entity Bean, I continually end up with a
EJBException.
Platform: XP. Tomcat 5.5. Sun App Server 8.2 via NetBeans IDE 5.5

Here's the StackTrace when i try logging in:

Successful Lookup user:hi Login Unsuccessful! null javax.ejb.EJBException at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:2807) at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:2713) at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2521) at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:819) at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:199) at $Proxy87.findByPrimaryKey(Unknown Source) at web.ControllerBean.validateCustomer(ControllerBean.java:121) at org.apache.jsp.controller_jsp._jspService(controller_jsp.java:71) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475) at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371) at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281) at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83) Caused by: com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store. NestedException: java.sql.SQLException: Error in allocating a connection. Cause: sun.jdbc.odbc.JdbcOdbcDriver at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:870) at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786) at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673) at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849) at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681) at enterprise.CustomerBean1419158425_ConcreteImpl.jdoGetPersistenceManager(CustomerBean1419158425_ConcreteImpl.java:1464) at enterprise.CustomerBean1419158425_ConcreteImpl.ejbFindByPrimaryKey(CustomerBean1419158425_ConcreteImpl.java:972) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:983) at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147) at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:738) at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:181) ... 40 more
Srihari Murali
Greenhorn

Joined: Oct 28, 2006
Posts: 4
I made some minor changes. Now i get a NullPointerException.

Now when i click login.html --> output goes to a jsp page. The associated JavaBean calls the CustomerLocalHome interface of my CMP Entity Bean. Here's the Stack Trace:

Successful Lookup user:yo NULL PTR EX java.lang.NullPointerException java.lang.NullPointerException at web.ControllerBean.validateCustomer(ControllerBean.java:120) at org.apache.jsp.controller_jsp._jspService(controller_jsp.java:71) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475) at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371) at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281) at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

java.lang.NullPointerException at web.ControllerBean.validateCustomer(ControllerBean.java:120)


Check what's the statement on line 120 of ControllerBean.java. The code is doing some operation on a null object.


[My Blog] [JavaRanch Journal]
Srihari Murali
Greenhorn

Joined: Oct 28, 2006
Posts: 4
The line is
120: public boolean validateCustomer() throws Exception
121: try {
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

You will have to debug your validateCustomer method (or use System.out.println statements in that method to identify the object which is null), since the NullpointerException is coming from that method.
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
It would be helpful if you can post your codes for ControllerBean.java and also controller.jsp


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
It would be helpful if you can post your codes for ControllerBean.java and also controller.jsp
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Oops, can moderators remove my duplicated entries? Problem with browser just now. Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB 2 + Sql Server 2000