• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

EJB in action Chapter 2 code error

 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Water proof donuts! Eat them while reading this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic