aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJB in action Chapter 2 code error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Professional Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "EJB in action Chapter 2 code error" Watch "EJB in action Chapter 2 code error" New topic
Author

EJB in action Chapter 2 code error

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 640
Hi

I am trying to run EJB3 in action Chapter 2 code.

I am using Jboss version 4.2.2GA.
I am using defulat DB (Hyersonic DB)

I ran ant script to build an EAR file for Chapter 2 code and then i placed the EAR file on Jboss'deploy folder. On placing EAR file, i get below mentioned error on command prompt

" java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@e69accf7[file =C:\jboss-4.2.2.GA\server\default\data\hypersonic\localDB.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: java.io.IOException: The process cannot access the file because another process has locked a portion of the file : C:\jboss-4.2.2.GA\server\default\data\"


I am not able to understand which process is having a lock on DB
Please help me

Thanks
Abhay
Davide Crudo
Ranch Hand

Joined: Sep 08, 2009
Posts: 62
...did you by any chance "kill" Jboss before?

It looks like you have a lock on the database that was not released...maybe jboss crashed or something and the lock remained...

Now i don't know hypersonic ...but sometimes on file based DBs you get the "lck" file with the current locked informations...and in
that case deleting the lck file would solve the issue...

...maybe try to copy the lck file out of the directory and see if it fixes the problem...

Dave

SCJP, SCBCD
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6564

In addition to what Dave mentioned, you actually can stop the server, delete the complete JBOSS_HOME/server/< servername>/data folder and start the server again.

[My Blog] [JavaRanch Journal]
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 640
hi

I found the solution.

i was trying to create/build Chapter 2 code with JBOSS server running.
When i ran Chapter 2 Code ant script without JBOSS running, it worked for me

Thanks
Abhay
 
 
subject: EJB in action Chapter 2 code error
 
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture