This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | No suitable driver found when executing JPQL query with a non bundled jdbc driver | ||
---|---|---|---|
Product: | javaee | Reporter: | alied <alied> |
Component: | Persistence | Assignee: | Sergey Petrov <sj-nb> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | MackSix, pjiricka |
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
alied
2014-02-14 22:53:40 UTC
if query will not work in the application, i.e. if to start this maven java project, it will not work in nb environment also. it's expected result. on other side jpql executor tries to find suitable driver in case if it's registered in nb, may be jtds isn't recognized by some code. as a workaround it should work to add the driver to application classpath (In reply to Sergey Petrov from comment #2) > as a workaround it should work to add the driver to application classpath You mean adding jtds as a dependency on the POM? No, that does not work either. I missed that step, but it does not fix it (tested it again). Also, the SQL pane keeps telling me to build the application. So: 1- It's not a JDBC URL issue. Te IDE-registered connection works fine. 2- The driver is a dependency of the application. The issue seems to be with drivers not bundled with the IDE (e.g. jtds). (In reply to Sergey Petrov from comment #1) > if query will not work in the application, i.e. if to start this maven java > project, it will not work in nb environment also. it's expected result. The tested query is one created by the "Create Entities from database" and the most trivial one: "SELECT e FROM Entity e" > on other side jpql executor tries to find suitable driver in case if it's > registered in nb, may be jtds isn't recognized by some code. The driver works from Services/Databases/connection and from the application. The persistence.xml is created with that connection. ok, it's strange, need to setup environment to evaluate What server should I install? (In reply to Sergey Petrov from comment #6) > What server should I install? I tried with both MS SQL Server 2008 and 2012 (both failed) I tried to get the PetCatalog demo to use it and I get the same results. I tried putting the driver (jtds-1.3.1.jar) in the NetBeans ide/modules/ext folder and added the jar to the libraries folder in the project to no avail. The connection in the Services tabs works and queries the database fine. (MS SQL Server 2012 Express) (In reply to Sergey Petrov from comment #5) > ok, it's strange, need to setup environment to evaluate When you install SQL Server 2012, run the SQL Server configuration manager and enable TCP/IP under the SQL Server Network Configuration and then look at the Properties for the SQL Server Browser and under the Service tab, change the start mode to manual or automatic and then start the SQL Server Browser. I put the jTDS ntlmauth.dll in the Windows folder and running Windows Authentication. ok, thanks. I see this exception is different from an exception in case if jdbc jar isn't added to classpath and an application is executed. Unfortunately corresponding jar is added to jpql execution classpath and the cause is somewhere else. Can we raise priority on this one? regarding priority, at current state it doesn't matter much in order to fix in 8.0, I'm evaluation right now, but in case it can't be fixed fast, it's more likely to add a message like "sorry jtds isn't supported" as a fix. also, real problem behind is "I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property." It's hidden by eclipselink which re-throw the exception. jtds can't load dll it require for windows authentication if executed the way it's required for jql execution, But common solutions do not work foe me in this case. suppose it may work in case of sql authentication but haven't tried. just tried with sa login access, and jpql execution works fine in this case. I finally figured out how to add a SQL Server Login and it connects if I do a JPQL query, but I don't know how to do a JPQL query and it tells me "Item" is unknown. :) SELECT i FROM Item i WHERE i.itemid = 10 it's another issue, even your connection have some schema marked as default, you have to specify schema in @Table for your entities sorry, I do not see ability to fix it yet, you have to use sql access instead of native windows as requirement/workaround I don't have much control on native calls from microsoft sql driver and it's hard to investigate this area also. |