File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB in action Chapter 2 code error

 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...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
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Abhay Agarwal
Ranch Hand
Posts: 1375
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic