Updating ConnectionPool in Glassfish when derby is upgraded - java

I was using Glassfish4 with Eclipse and derby-10.6 with JEE. Everything was working fine. Then for some tutorials I switched to Netbeans8.1 which had Glassfish4.1.1 and derby-10.12. Now I am back to Eclipse and want to start from where I left. Meanwhile database created by derby-10.6 is upgraded by 10.12. How can I change settings in Glassfish4 so that it can connect to the database? I am guessing I need to change something with ConnectionPool.
The error I am getting is:
Error occurred during deployment: Exception while deploying the app [ejb] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 0, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'EmployeeDB' with class loader sun.misc.Launcher$AppClassLoader#61bbe9ba, see the next exception for details.::SQLSTATE: XSLANDatabase at C:...\db-derby-10.6.2.1-bin\bin\EmployeeDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.9. Error Code: 0. Please see server.log for more details.
Note that, I don't have derby-10.9.

Related

How do I install PostgreSQL on a Payara Docker container?

I'm trying to install create a container that runs a Payaraserver with my JAX-RS application. Getting the server running wasn't too hard, I simply used the official image. However, when I create the Connection Pool I was not able to ping, and I got this error message:
Ping Connection Pool failed for PostgreSQLPool.
Class name is wrong or classpath is not set for :
org.postgresql.ds.PGConnectionPoolDataSource Please check the server.log for more details.
Also, when i tried to upload the .war file (after I had created the DataSource) I got this error message:
Error occurred during deployment: Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.7.7.payara-p3): org.eclipse.persistence.exceptions.DatabaseException Internal Exception:
java.sql.SQLException: Error in allocating a connection. Cause:
org.postgresql.ds.PGConnectionPoolDataSource cannot be cast to javax.sql.DataSource Error Code:
0. Please see server.log for more details.
After a bit of digging I thought that the problem was that I did not have the postgre jdbc driver in the container. I created this Dockerfile:
FROM payara/server-full
COPY postgresql-42.2.18.jar /opt/payara41/glassfish/domains/domain1/lib
, which I thought would add the .jar file to the container. Unfortunately, no change was made. I have the exact same configurations on a local installation of Payara and everything works just fine there.
Is there something that I'm missing? I'm quite new to dockers, so if someone would be able to pint me in the right direction, I would really appreciate it.

cannot establish a connection jdbc:derby database

I am getting the following error when connecting to the derby database (test1) in netbeans 8.0. please give some suggestions to fix this error.
Unable to connect. Cannot establish a connection to jdbc:derby://localhost:1527/test1 using org.apache.derby.jdbc.ClientDriver (DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'test1' with class loader sun.misc.Launcher$AppClassLoader#631d75b9, see the next exception for details.::SQLSTATE: XSLANDatabase at C:\Users\Chirath.netbeans-derby\test1 has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.10.).

SQLJDBC driver is not supported by JRE 1.7

I am trying to develop RESTful JAVA web service using Netbeans and MS SQL Server 2008 as DBMS.
I am registering sqljdbc4.jar as a driver but still it is showing me this error while deploying the project. I tried all the options available online and also removed driver, relocated driver did every thing except uninstalling entire developing package(Netbeans, JDK, SQL Server 2008).
Following is the error:
Error occurred during deployment: Exception while deploying the app [webapptest1] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Java Runtime Environment (JRE) version 1.7 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
Error Code: 0. Please see server.log for more details.
Use jTDS which is an opensource driver which supports MS Sql Server

What are the __pm and __nontx suffixes?

My java EE application is giving following error when i try to run the application on glassfish server. It says "Invalid resource : jdbc/busservice__nontx". Where should i look to fix this error? Previously it was giving error with "jdbc/busservice__pm". Once I created JDBC resource and connected with connection pool, error disappeared. However i'm still getting error with "jdbc/busservice__nontx"
Info: PER02100: Could not load Toplink Essentials. Assuming this is an upgrade from V2. Switching Persistence Unit [BusReservationPU] to use [org.eclipse.persistence.jpa.PersistenceProvider] as JPA provider. If you intend to use Toplink Essentials, please ensure that it is visible to your application."
Severe: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
Severe: java.lang.RuntimeException: Invalid resource : jdbc/busservice__nontx
at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:593)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupNonTxResource(ConnectorRuntime.java:559)
at org.glassfish.persistence.common.PersistenceHelper.lookupNonTxResource(PersistenceHelper.java:59)
at org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupNonTxDataSource(ProviderContainerContractInfoBase.java:76)
at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:109)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:142)
Do not add "jdbc/busservice__pm" to your Glassfish JDBC Resources, just add it as "jdbc/busservice". It looks like the __pm and __nontx are some internal names that it adds to the end of your jdbc name internally, and when you specifically add it will mess it up and throw that error.

java.sql.SQLException: Table 'QRTZ_TRIGGERS' is marked as crashed and should be repaired

When starting Tomcat 5.5.26 instance on RHEL 3.4 AS, I am getting this error message:
2010-09-15 12:34:15,415 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].
[localhost].[/srs].[login-info]] - <Allocate exception for servlet login-info>
org.quartz.SchedulerConfigException: Failure occured during job recovery. [See
nested exception: org.quartz.JobPersistenceException: Couldn't clean volatile data: Table
'QRTZ_TRIGGERS' is marked as crashed and should be repaired [See nested exception:
java.sql.SQLException: Table 'QRTZ_TRIGGERS' is marked as crashed and should be
repaired]] at
g.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:493)`
How do I repair this?
Incidentally, this error under Tom Cat was for a Bioinformatics application called "SRS" by BioWisdom.
I resolved the issue myself. The problem was not with Tomcat but with the application that was running underneath it. The application was using a MySQL database that had crashed due to a disk full condition. Repairing the table didn't help, so a new database had to be created. Luckily, this was easy.

Categories