I have a database connection to HSQL in Eclipse via the Data Source Explorer (DSE). I can browse the existing HSQL database just fine, and then I disconnect and start a web app that uses the same database. After disconnecting, my web app won't start unless I restart Eclipse because it says the HSQL database is locked.
If I start Eclipse and run my web app then it works fine.
What it looks like is that when I disconnect hte Eclipse DSE it does not actually release the lock properly.
Any ideas?
For anyone who is still looking for an answer:
HSQLDB lock file is not released from Eclipse Data source explorer when you disconnect, when you connect to file based URL. To release the lock, execute SHUTDOWN command on the DB (e.g. by opening SQL Scrapbook against the connection and executing SHUTDOWN as an SQL statement) and then disconnect. Also, this command could even be executed by starting a new session from the data source explorer itself, if you have disconnected before executing the shutdown command.
Related
I have 2 versions of my app deployed on the cloud. They both have same address, but different cloud instance names.
I am able to debug one application from cloud, but when I try to connect to the other one, eclipse gives the error:
Error launching a Cloud Debugging Session.
Server returned 409 (Conflict) for URL: 'address'
Another debugging/profiling session to this application seems to be active.
There is no sessions available in Debug view. I even restarted eclipse and my machine.
Is there a way to kill all/any debugging/profiling sessions in eclipse?
I was able before to switch debugging from one cloud app to the other but today I get this issue.
I am in a bind here, what's happening is I have a legacy webapp which uses an in-memory database. The app requires 64GB of RAM just to launch and it takes at least 30 minutes to start.
I have to make updates/fixes to this application. Obviously it is impossible to launch it on my PC so everything has to be done on the server. I have considered setting up an Eclipse IDE on the Linux server where this app runs, but that introduces a set of new issues. I really would like to continue using my PC's Eclipse IDE and make edits to the app.
I am able to use the remote debugging capabilities of Eclipse IDE and launch this app from the linux server no problem. However this is not enough. After I make an edit, I need to be able to save/compile the file, and load this change into the server relatively quickly. I can't wait 30 minutes every time I make some updates to the app.
Can anyone recommend ideas on what to do in this scenario? Ideally I would love to be able to launch the app in DEBUG mode inside the Linux Eclipse IDE on the server and connect to this instance using remote debugging from my local/Windows IDE. I would like to make changes in my Windows Eclipse IDE and then quickly copy the files over to the linux server, pick them up in the Linux Eclipse IDE, compile them in the Eclipse IDE instance running in debug mode, and effectively "hot swapping" the changes, thereby avoiding the need to wait 30 minutes for the app to start back up... However when I try to do this, there is a caveat... I can't seem to be able to launch the webapp in Linux Eclipse IDE in both DEBUG mode and also remote-debug-connect to it, the error I am getting in Eclipse is:
"Cannot load this JVM TI agent twice"
I get what is going on: the local debugger is launching tomcat with the -agentlib:jdwp parameter and on top of it, I am trying to force it to also start up with the same arguments and so it complains, but is there some way to trick it into allowing me to remote connect into this debug session from my Windows server?
I managed to solve this issue by updating Tomcat's context.xml to support reloadable mode:
<Context reloadable="true">
And in the app to set it to reloadable in WEB-INF/web.xml:
<web-app reloadable="true">
Now I am able to make edits in my local windows Eclipse IDE, Save them, and they automatically get updated on the server side.
I'm running on Win 7 using Eclipse 4.2 starting a web app on a Tomcat 7 server and using Derby database. I have tried many approaches but run consistently into a common problem:
Everything works just fine the first time I start up and run.
When I redeploy my application after a change, all database connections hang (any kind of restart).
If I stop Eclipse and restart Eclipse, that clears up the problem and the next run works fine again.
Having done some investigation, it appears that the problem is that the Derby port (1527) is not released from one execution of the server to the next. That seems very strange to me since Derby is started by the Tomcat instance which is a separate javaw process.
I've tried:
Configuring the Derby connection as a Tomcat resource
Establishing the connection within my code (rather than via Tomcat resource)
Both the embedded and the network driver
Starting / stopping the network driver from a servlet on startup and shutdown of the Tomcat server
Shutting down the embedded driver via servlet on shutdown of Tomcat
Again, every approach works fine to connect the first time.
One other symptom that doesn't appear to be related (except for as a possible indicator of whether or not shutdown completes correctly) is that the db.lck file for my database never gets deleted. However, whether or not it exists has no bearing on whether or not I can reconnect (only stopping/starting eclipse has an impact).
Any insight would be appreciated.
Thanks!
After some further investigation I'm going to call this a duplicate of: Cannot create JDBC driver of class ' ' for connect URL 'null' : I do not understand this exception. It's not quite the same thing, but that solution (creating META-INF/context.xml) allows it to proceed to failing calls rather than hangs, which is a significant improvement and suggests it's largely related.
I did finally figure this out. It turns out I had the derby jars in the Tomcat lib folder (for Tomcat) and in the deployment assembly for my application in Eclipse (rather than just in the build path). So Tomcat was using the built-in libs, while my app was using the embedded libs, and this resulted in conflicts. Leaving the libs as part of Tomcat and removing them from my war file solved the problem completely.
It would be great if someone can help me on this:
I configured a tomcat server for doing remote debugging using eclipse:
I used the gui for tomcat7
If I run tomcat with the command
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n it works fine but
If I put suspend=y in the above command tomcat sert hangs in starting state and does not stop at all even after 2-3 hours.
When using suspend=y, the JVM remains suspended until a debug client connects.
To connect to the suspended Tomcat instance, you can create a new Eclipse Debug Configuration via Run->Debug Configurations. Then choose Remote Java Application. On the configuration panel, specify the host and port e.g. 8000 to connect. Finally, press Debug. This will attempt to connect to your suspended Tomcat instance. Once, the connection is made you can step through the code. (Of course, you must load that code into the Eclipse workspace)
I use Netbeans to develop a project with JSF, JPA and Java database. I can make a back up online by right clicking the database connections under services and excuting CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE('c:/tem/2005-06-01') command. But how can I restore or create a database from that backup.
Several articles state that to use jdbc:derby:sample;restoreFrom=c:\mybackups\sample in the in the boot time connection URL. What is boot time connection? I tried to use it as the connection string in Netbeans new connection dialog, but that was not successful.
Please tell me how can I restore the backup.
There is a wealth of information about backing up and restoring Derby databases here: http://db.apache.org/derby/docs/10.9/adminguide/cadminhubbkup98797.html
If you're not comfortable using Derby outside of the Netbeans environment, start here: http://db.apache.org/derby/docs/10.9/getstart/