Wednesday, January 31, 2007

Developing the JEE application, how tears appeared in my eyes... [an update]

Hi,

Last night I blogged about my misfortunes with NB's JEE support and promised to keep on updating while I thought I was making progress. And there's something more to tell.

And some progress was made since my previous blog. I found out that I can actually run the application and test the WS from the IDE (right-click on the WS and test it), but I can't debug the application. That results in errors.
When I start debugging the application, I get the following output in NB's output window for ANT:

pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
do-dist-without-manifest:
do-dist-with-manifest:
post-dist:
dist:
run-debug:
Distributing
C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\dist\IFFServer
.ear to [localhost:4848_server]
Start registering the project's server resources
Finished registering server resources
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
WARNING:
JDO76614: Deployment encountered SQL Exceptions:
JDO76609: Got SQLException executing statement "CREATE TABLE
SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY
(SEQ_NAME))": org.apache.derby.client.am.SqlException: Table/View 'SEQUENCE'
already exists in Schema 'IWAN'.
JDO76614: Deployment encountered SQL Exceptions:
JDO76609: Got SQLException executing statement "CREATE TABLE
IFFPLAYER_IFFALLIANCE (alliances_ID BIGINT NOT NULL, members_ID BIGINT NOT
NULL, PRIMARY KEY (alliances_ID, members_ID))":
org.apache.derby.client.am.SqlException: Table/View 'IFFPLAYER_IFFALLIANCE'
already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "CREATE TABLE
IFFALLIANCE (ID BIGINT NOT NULL, ALLIANCE_NAME VARCHAR(255), PRIMARY KEY
(ID))": org.apache.derby.client.am.SqlException: Table/View 'IFFALLIANCE'
already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "CREATE TABLE
IFFGAMEFIELD (ID BIGINT NOT NULL, INITED SMALLINT DEFAULT 0, FIELDTYPE
INTEGER, ARMY INTEGER, SOUTHEAST_ID BIGINT, NORTH_ID BIGINT, PLAYER_ID
BIGINT, NORTHEAST_ID BIGINT, PRIMARY KEY (ID))":
org.apache.derby.client.am.SqlException: Table/View 'IFFGAMEFIELD' already
exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "CREATE TABLE
IFFPLAYER (ID BIGINT NOT NULL, TAG VARCHAR(255), PLAYER_NAME VARCHAR(255),
LANG VARCHAR(255), PRIMARY KEY (ID))":
org.apache.derby.client.am.SqlException: Table/View 'IFFPLAYER' already
exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFPLAYER_IFFALLIANCE ADD CONSTRAINT FFPLYRFFLLNCllncsD FOREIGN KEY
(alliances_ID) REFERENCES IFFALLIANCE (ID)":
org.apache.derby.client.am.SqlException: Constraint 'FFPLYRFFLLNCLLNCSD'
already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFPLAYER_IFFALLIANCE ADD CONSTRAINT FFPLYRFFLLNCmmbrsD FOREIGN KEY
(members_ID) REFERENCES IFFPLAYER (ID)":
org.apache.derby.client.am.SqlException: Constraint 'FFPLYRFFLLNCMMBRSD'
already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFGAMEFIELD ADD CONSTRAINT FFGMEFIELDSTHASTID FOREIGN KEY (SOUTHEAST_ID)
REFERENCES IFFGAMEFIELD (ID)": org.apache.derby.client.am.SqlException:
Constraint 'FFGMEFIELDSTHASTID' already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFGAMEFIELD ADD CONSTRAINT FFGAMEFIELDNORTHID FOREIGN KEY (NORTH_ID)
REFERENCES IFFGAMEFIELD (ID)": org.apache.derby.client.am.SqlException:
Constraint 'FFGAMEFIELDNORTHID' already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFGAMEFIELD ADD CONSTRAINT FFGAMEFIELDPLYERID FOREIGN KEY (PLAYER_ID)
REFERENCES IFFPLAYER (ID)": org.apache.derby.client.am.SqlException:
Constraint 'FFGAMEFIELDPLYERID' already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "ALTER TABLE
IFFGAMEFIELD ADD CONSTRAINT FFGMFIELDNRTHASTID FOREIGN KEY (NORTHEAST_ID)
REFERENCES IFFGAMEFIELD (ID)": org.apache.derby.client.am.SqlException:
Constraint 'FFGMFIELDNRTHASTID' already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "CREATE TABLE
SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL, PRIMARY KEY
(SEQ_NAME))": org.apache.derby.client.am.SqlException: Table/View 'SEQUENCE'
already exists in Schema 'IWAN'.
JDO76609: Got SQLException executing statement "INSERT INTO
SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 0)":
org.apache.derby.client.am.SqlException: The statement was aborted because
it would have caused a duplicate key value in a unique or primary key
constraint or unique index identified by 'SQL061208085840450' defined on
'SEQUENCE'.
Enable of IFFServer in target server completed successfully
Enable of application in all targets completed successfully
All operations completed successfully
Duplicated project name in import. Project IFFServer-impl defined first in
C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\nbproject\ant-
deploy.xml and again in
C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\nbproject\buil
d-impl.xml
connect-debugger:
Non-existing path
"C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\${javac.class
path}" provided.
Attached JPDA debugger to localhost:9009
pre-run-deploy:
Redeploying
C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\dist\IFFServer
.ear
Start registering the project's server resources
Finished registering server resources
While redeploying, trying to stop the application in target server
completed successfully
While redeploying, trying to remove reference for application in target
server completed successfully
deployment started : 0%
Deploying application in domain failed; Could not rename
C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFSe
rver to
C:\Programs\Sun\AppServer\9.UR1\domains\domain1\applications\j2ee-apps\IFFSe
rver_old
At least one operation failed
C:\Iwan\SticktailGames\projects\FriendOrFoe\backend\IFFServer\nbproject\buil
d-impl.xml:174: Deployment error:
The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 34 seconds)


Appearantly, mentioned in a reply on a post from me on the NBUSERS mailing list, I have to add DROP statements in my DDL, which should fix things. Something I'll try tonight, it would be great to be able to debug the application using a debugger instead of System.out.println(...) statements all over the place.

Iwan

3 comments:

Sruji said...

I am having similar problem. Can you please post a solution for it. cheers

Unknown said...

I finally got it all to work by starting Glassfish in debug mode, and connect NetBeans' debugger remotely. That did the job. So use the remote debugger on an debuggable instance of Glassfish instead of debugging directly.

Iwan

Anonymous said...

@iwan :Yes, u'r right