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: | error accessing the postgresql database | ||
---|---|---|---|
Product: | javaee | Reporter: | bgk <bgk> |
Component: | Persistence | Assignee: | Matthew Bohm <mbohm> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | CC: | jhorvath, romanmostyka |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | Other | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
bgk
2008-11-07 22:25:32 UTC
Reassigning to persistence for evaluation. You only need to quote the database identifiers if you quoted them when you created them. If you don't quote when you create, you shouldn't have to quote when you refer to the identifiers in your queries. bgk, I was not able to reproduce the error described in this issue. Please attach the schema of your database and specify the postgres version. Postgres version is 8.2. and server is glassfish v2 on You can create any table in the database and try the default options for creating entities from table and then jsf from the entity classes. eg: I created a table REF_GENDER as follows: CREATE TABLE "REF_GENDER" ( "GENDER_CD" character varying(1) NOT NULL, "GENDER_DESCRIPTION" character varying(10), CONSTRAINT "REF_GENDER_PK" PRIMARY KEY ("GENDER_CD") ) WITHOUT OIDS; ALTER TABLE "REF_GENDER" OWNER TO postgres; Next I create a new web application > java server faces framework in netbeans Click on the project name and select create entity classes from database Select the appropriate db connection and select the table ENT_GENDER. Selected persistence unit option. The view the class is created fine. Then select option to create jsf from entity classes for this class. then build and run the application. compile fine and displays the WelcomeJSF.Jsp page with hyperlink to the show all RefGender Items as follows. But when u click on the hyperlink to see the gender items, it just shows the wait icon as when trying to retrieve data for the page. "JavaServer Faces Show All RefGender Items " Here are the logs: init: deps-module-jar: deps-ear-jar: deps-jar: Created dir: C:\java\Test_Gender\build\web\WEB-INF\classes Created dir: C:\java\Test_Gender\build\web\META-INF Copying 1 file to C:\java\Test_Gender\build\web\META-INF Created dir: C:\java\Test_Gender\build\web\WEB-INF\classes\META-INF Copying 1 file to C:\java\Test_Gender\build\web\WEB-INF\classes\META-INF Copying 12 files to C:\java\Test_Gender\build\web library-inclusion-in-archive: Copying 1 file to C:\java\Test_Gender\build\web\WEB-INF\lib Copying 1 file to C:\java\Test_Gender\build\web\WEB-INF\lib Copying 1 file to C:\java\Test_Gender\build\web\WEB-INF\lib Copying 1 file to C:\java\Test_Gender\build\web\WEB-INF\lib library-inclusion-in-manifest: compile: compile-jsps: Created dir: C:\java\Test_Gender\dist Building jar: C:\java\Test_Gender\dist\Test_Gender.war In-place deployment at C:\java\Test_Gender\build\web Start registering the project's server resources Finished registering server resources moduleID=Test_Gender deployment started : 0% deployment finished : 100% Deploying application in domain completed successfully Trying to create reference for application in target server completed successfully Trying to start application in target server completed successfully Deployment of application Test_Gender completed successfully Enable of Test_Gender in target server completed successfully Enable of application in all targets completed successfully All operations completed successfully run-deploy: Browsing: http://localhost:8080/Test_Gender/ run-display-browser: run: BUILD SUCCESSFUL (total time: 1 minute 6 seconds) LIST.jsp accept text/javascript, text/html, application/xml, text/xml, */* Edit... accept-language en-us Edit... x-prototype-version 1.5.0_rc1 Edit... referer http://localhost:8080/Test_Gender/ Edit... x-requested-with XMLHttpRequest Edit... com.sun.faces.avatar.partial true Edit... content-type application/x-www-form-urlencoded Edit... accept-encoding gzip, deflate Edit... user-agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.5.20404; .NET CLR 3.0.04506.648) Edit... host localhost:8080 Edit... content-length 1612 Edit... connection Keep-Alive Edit... cache-control no-cache Edit... cookie JSESSIONID=72a4c2ba303f80a477e60521ac88 Edit... It's the persistence provider (toplink) that formulates the actual sql. I don't believe the netbeans-generated jpaql can influence the resulting sql at that level, that is, with respect to quotation marks, etc. If it's an issue with quotation marks, the solution, as davidvc discusses, may be to create the database without quotes. Sorry to downgrade to P3, but we do not yet know that the IDE can control this. If it's truly something under IDE control, we can always bump the priority up again. bgk, can you create the database without quotes and retry? Hi, I don't think it is problem with "" as I did not create the database with "" but used everything default- default creation of table in postgres, default creation of entity classes from database in NB and default creation of jsf pages for the entity classes created (in net beans) but it give issue with accessing the list.jsp created. Thanks, bgk bgk, thanks--but why do you have the quotes in your earlier note: <snip> eg: I created a table REF_GENDER as follows: CREATE TABLE "REF_GENDER" ( "GENDER_CD" character varying(1) NOT NULL, "GENDER_DESCRIPTION" character varying(10), CONSTRAINT "REF_GENDER_PK" PRIMARY KEY ("GENDER_CD") ) WITHOUT OIDS; ALTER TABLE "REF_GENDER" OWNER TO postgres; </snip> We'll need the database schema, postgres version, and possibly the project as attachments in order to investigate. Thanks! The output is default when the table name and columns are upper case. if you select a table in postgres and right click to "create script" it generates this creation script for a table. Just used it for generating the table in postgres. Right, so one thing to try might be tweaking the script (removing quotes) and regenerating your database schema from the tweaked script. If it works, then we can be pretty certain about the cause. Thanks. It does appear to be the problem with the quotes that are automatically generated (I think when the names are uppercase in tables) I created tables in lowercase and it does not have quotes and goes through without problems. That proves the point that the " " placed by default by Postgres to represent upper case table/column names is the problem. any suggestions (other than changing the table names (which may not be an option..as other application works) to fix the issue? Maybe try tweaking the script to use uppercase and without quotes, and then regenerate your database schema from the newly tweaked script? Without requested information for long time - INVALID. We can't do anything in this case. Reporter, please add requested information and reopen issue. Thanks in advance. |