aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Glassfish connecting to MS SQL server error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Glassfish connecting to MS SQL server error" Watch "Glassfish connecting to MS SQL server error" New topic
Author

Glassfish connecting to MS SQL server error

Meherdad Bomanbehram
Ranch Hand

Joined: May 28, 2007
Posts: 140

Hi all ,
I am trying to connect to Microsoft SQL server from gassfish using the jtds driver ,the "microsoft_jtds_datasource.xml" in is the "C:\Program Files\glassfish-v2\domains\domain1\lib\ext" directory



my persistance.xml is


I created the entity class from the database using the netbeans IDE


I call this class from my session bean


which is in turn called from m servlet

but when I try to run this application I get the following eror could someone pls tel me why and how to sort this out ?



Application server startup complete.
CORE5022: All ejb(s) of [JV] were unloaded successfully!
deployed with moduleid = JV
naming.bind
LDR5010: All ejb(s) of [JV] loaded successfully!
TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))
Server: unknown
file:/C:/Documents%20and%20Settings/BomanbehramM/My%20Documents/NetBeansProjects/JV/dist/gfdeploy/JV-ejb_jar/-JV-ejbPU login successful
EJB5018: An exception was thrown during an ejb invocation on [CountrySessionBean]
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3869)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
at $Proxy57.getAllCountries(Unknown Source)
at jv.web.jvServlet.processRequest(jvServlet.java:45)
at jv.web.jvServlet.doGet(jvServlet.java:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.IllegalArgumentException: An exception occured while creating a query in EntityManager
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.createQuery(EntityManagerImpl.java:209)
at com.sun.enterprise.util.EntityManagerWrapper.createQuery(EntityManagerWrapper.java:662)
at jv.ejb.CountrySessionBean.getAllCountries(CountrySessionBean.java:32)
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:597)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
... 38 more
Caused by: Exception [TOPLINK-8034] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Error compiling the query [select c from country c]. Unknown abstract schema type [country].
at oracle.toplink.essentials.exceptions.EJBQLException.unknownAbstractSchemaType(EJBQLException.java:494)
at oracle.toplink.essentials.internal.parsing.ParseTreeContext.classForSchemaName(ParseTreeContext.java:163)
at oracle.toplink.essentials.internal.parsing.SelectNode.getClassOfFirstVariable(SelectNode.java:366)
at oracle.toplink.essentials.internal.parsing.SelectNode.getReferenceClass(SelectNode.java:354)
at oracle.toplink.essentials.internal.parsing.ParseTree.getReferenceClass(ParseTree.java:463)
at oracle.toplink.essentials.internal.parsing.ParseTree.adjustReferenceClassForQuery(ParseTree.java:103)
at oracle.toplink.essentials.internal.parsing.EJBQLParseTree.populateReadQueryInternal(EJBQLParseTree.java:127)
at oracle.toplink.essentials.internal.parsing.EJBQLParseTree.populateQuery(EJBQLParseTree.java:108)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:219)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:189)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabaseQuery(EJBQueryImpl.java:153)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>(EJBQueryImpl.java:114)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>(EJBQueryImpl.java:99)
at oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl.<init>(EJBQueryImpl.java:86)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.createQuery(EntityManagerImpl.java:204)
... 49 more



Please help !!!
[ May 25, 2008: Message edited by: Bear Bibeault ]
Rodrigo Lopes
Ranch Hand

Joined: Feb 29, 2008
Posts: 119
In the getAllCountries() method from your bean, the query should be "select c from Country c".
It's an EJBQL query, so it must use class name, not table name.
Meherdad Bomanbehram
Ranch Hand

Joined: May 28, 2007
Posts: 140

Thanks Rodrigo,
but as you can see my query is "select c from Country c".
Any further guidance is most wellcome.

Many thanks.
Rodrigo Lopes
Ranch Hand

Joined: Feb 29, 2008
Posts: 119
As I can see, your query is "select c from country c"
The case is important
Meherdad Bomanbehram
Ranch Hand

Joined: May 28, 2007
Posts: 140

AAHHHHH I see the light now !!!
thanks dude I feel real stupid but thanks this really helped .

Regards
 
wood burning stoves
 
subject: Glassfish connecting to MS SQL server error