Re: Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread Dag H. Wanvik

Some advice can be found here:

http://wiki.apache.org/db-derby/DatabaseCorruption

Thanks,
Dag

On 10. mars 2014 12:49, Phil Bradley wrote:

Hi,

I have a derby database that I am unable to connect to; when I try I get
"java.lang.ArrayIndexOutOfBoundsException". The full stack trace is
shown below.

Firstly, some background:

- I'm using derby 10.8.2.2 with a Java Webstart application that
connects in embedded mode. The clients are using Java 7u45 on Windows 7,
32 bit

- The application is configured to run SYSCS_UTIL.SYSCS_COMPRESS_TABLE()
every 5 days on each table on startup

- The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a
particular table and based on the application logs, it looks like either
the JVM crashed or the application was ended via task manager.

- On subsequent attempts to start the application, the client was unable
to connect to the database as per the stack trace below. I have made a
copy of the database and I get this error reliably on accessing the
copy.

I have two questions:

1. Is there anything that I can do to recover from this kind of scenario
automatically?
2. Is there any debugging or other investigation that I can do that will
help reduce the severity of this kind of problem?

Thanks,
Phil





java.sql.SQLException: Failed to start database
'C:\Users\Administrator\.myapp\myapp_db' with class loader
com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.(Unknown
Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown
Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
com.mycompany.database.DbInitializer.runScript(DbInitializer.java:143)
at

com.mycompany.myapp.ApplicationRunner.initialiseDb(ApplicationRunner.java:817)
at

com.mycompany.myapp.ApplicationRunner.startApplication(ApplicationRunner.java:945)
at
com.mycompany.myapp.ApplicationRunner.run(ApplicationRunner.java:581)
at
com.mycompany.myapp.ApplicationRunner.main(ApplicationRunner.java:552)
at
com.mycompany.myapp.ApplicationLoader.main(ApplicationLoader.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Failed to start database
'C:\Users\Administrator\.myapp\myapp_db' with class loader
com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at

org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
... 27 more
Caused by: java.sql.SQLException: Java exception: ':
java.lang.ArrayIndexOutOfBoundsException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at

org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
... 24 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.derby.impl.store.raw.data.AllocPage.ReadContainerInfo(Unknown
Source)
at
org.apache.derby.impl.store.raw.data.FileContainer.readHeader(Unknown
Source)
at org.apache.derby.impl.store.raw.d

Re: Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread mike matrigali

I don't have time to do remote diagnostics, but did look at the issue
a bit.  If you have the ability to run a "sane" server on the db that
might produce more information in the log.  I am not sure if the apache
release includes this, so it may only be available if you build your
own from source.

I looked at stack and source with Myrna and did see that it looks 
similar to a reported issue DERBY-5936.  Looking at the source it looks

like we get a bad value off the page while are "bootstrapping" the
page/container.  In the case of sane we do some error checking, in the
release we just get the ArrayIndexOutOfBoundsException.  The code
should at least catch that JAVA error and turn it into a better derby
error with some diagnostics about what the page looks like.  I will file
a JIRA for that.

It may help if you add your experience to comments in DERBY-5936, with
the stack and maybe derby.log if you have it and it looks any different
than the stack you posted.  Sometimes there is a previous error in
derby.log that then explains the following error.  Obviously do not
share derby.log if it looks like it has anything confidential from your
customer.  Also in that issue rick asked a number of questions and
did not get answers, so maybe you can answer for your situation.

I know you posted that you do compresses, though the type you said
you are using has not been the problem in the past.  I would be
especially interested if it is possible you had machine crashes/sudden
shutdowns vs JVM crash.

Derby is designed to be able to recover from any killing of the process
during any operation as long as the disk is properly synced.  So if your
disk is write-cache disabled then this is a bug and your machine did
not crash then this is definitely a derby bug.  There is an edge case
in machine crash where partial page writes are done by the OS, but derby
should be reporting checksum errors in that case.

It may help to post a long listing (on unix a "ls -l") of the files
in seg0 and in log.  This will show no user data, just the number of
files, numbered file names, and sizes of the files.  This may help
someone to repro this problem.

From the issue:
A couple questions we usually ask about data corruptions:

1) Do you compress database tables?

2) Is the disk write-cache enabled or disabled?

3) Did anything unusual happen before the corruption. E.g., an 
application or system crash?


Can you share the database with us so that we can crack it open and look 
for more clues? Can you send us derby.log? There may be more information 
in the full derby.log.


Thanks,
-Rick
On 3/10/2014 11:19 AM, Phil Bradley wrote:


Hi Myrna,
Thanks, the data in question is really just an offline cache so there's
no issue with data loss (and it's kind of understandable that killing
the process in the middle of compressing a table might not be best
practice:)

My second question was really "is a database in this state of use to the
derby developers?"  I'm not authorised to upload the database as part of
a bug report since it belongs to a client but if there are any Derby
developers out there that would like me to run some diagnostics then I'm
happy to do so.

Regards,
Phil




On Mon, Mar 10, 2014, at 16:20, Myrna van Lunteren wrote:

Although Derby has transaction control and a recovery mechanism, if a
JVM crashes or gets interrupted, the normal transaction steps might be
interrupted in unfortunate places, especially during compress. Was the
database shutdown before compress? Do you have a backup?

But perhaps there is something of use to you on this page:
https://wiki.apache.org/db-derby/DatabaseCorruption

HTH
Myrna



On Mon, Mar 10, 2014 at 4:49 AM, Phil Bradley mailto:ph...@tower.ie>> wrote:


Hi,

I have a derby database that I am unable to connect to; when I try
I get
"java.lang.ArrayIndexOutOfBoundsException". The full stack trace is
shown below.

Firstly, some background:

- I'm using derby 10.8.2.2 with a Java Webstart application that
connects in embedded mode. The clients are using Java 7u45 on
Windows 7,
32 bit

- The application is configured to run
SYSCS_UTIL.SYSCS_COMPRESS_TABLE()
every 5 days on each table on startup

- The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a
particular table and based on the application logs, it looks like
either
the JVM crashed or the application was ended via task manager.

- On subsequent attempts to start the application, the client was
unable
to connect to the database as per the stack trace below. I have made a
copy of the database and I get this error reliably on accessing the
copy.

I have two questions:

1. Is there anything that I can do to recover from this kind of
scenario
automatically?
2. Is there any debugging or other investigation that I can do
that will
help reduce the severity of this kind of problem?

Thanks,
Phil





java.sql.SQLExcepti

Re: Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread Phil Bradley

Hi Myrna,



Thanks, the data in question is really just an offline cache so there's
no issue with data loss (and it's kind of understandable that killing
the process in the middle of compressing a table might not be best
practice:)


My second question was really "is a database in this state of use to
the derby developers?"  I'm not authorised to upload the database as
part of a bug report since it belongs to a client but if there are any
Derby developers out there that would like me to run some diagnostics
then I'm happy to do so.


Regards,

Phil





On Mon, Mar 10, 2014, at 16:20, Myrna van Lunteren wrote:

Although Derby has transaction control and a recovery mechanism, if a
JVM crashes or gets interrupted, the normal transaction steps might be
interrupted in unfortunate places, especially during compress. Was the
database shutdown before compress? Do you have a backup?

But perhaps there is something of use to you on this page:
[1]https://wiki.apache.org/db-derby/DatabaseCorruption

HTH
Myrna



On Mon, Mar 10, 2014 at 4:49 AM, Phil Bradley <[2]ph...@tower.ie>
wrote:


Hi,


I have a derby database that I am unable to connect to; when I try I
get

"java.lang.ArrayIndexOutOfBoundsException". The full stack trace is

shown below.


Firstly, some background:


- I'm using derby 10.8.2.2 with a Java Webstart application that

connects in embedded mode. The clients are using Java 7u45 on Windows
7,

32 bit


- The application is configured to run
SYSCS_UTIL.SYSCS_COMPRESS_TABLE()

every 5 days on each table on startup


- The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a

particular table and based on the application logs, it looks like
either

the JVM crashed or the application was ended via task manager.


- On subsequent attempts to start the application, the client was
unable

to connect to the database as per the stack trace below. I have made a

copy of the database and I get this error reliably on accessing the

copy.


I have two questions:


1. Is there anything that I can do to recover from this kind of
scenario

automatically?

2. Is there any debugging or other investigation that I can do that
will

help reduce the severity of this kind of problem?


Thanks,

Phil






java.sql.SQLException: Failed to start database

'C:\Users\Administrator\.myapp\myapp_db' with class loader

com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for

details.

at


org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknow
n

Source)

at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown

Source)

at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown

Source)

at

org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown

Source)

at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown

Source)

at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown

Source)

at org.apache.derby.impl.jdbc.EmbedConnection40.(Unknown

Source)

at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown

Source)

at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)

at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown

Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at


com.mycompany.database.DbInitializer.runScript(DbInitializer.java:143)

at


com.mycompany.myapp.ApplicationRunner.initialiseDb(ApplicationRunner.ja
va:817)

at


com.mycompany.myapp.ApplicationRunner.startApplication(ApplicationRunne
r.java:945)

at


com.mycompany.myapp.ApplicationRunner.run(ApplicationRunner.java:581)

at


com.mycompany.myapp.ApplicationRunner.main(ApplicationRunner.java:552)

at


com.mycompany.myapp.ApplicationLoader.main(ApplicationLoader.java:90)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown

Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.sun.javaws.Launcher.executeApplication(Unknown Source)

at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.sql.SQLException: Failed to start database

'C:\Users\Administrator\.myapp\myapp_db' with class loader

com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for

details.

at


org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown

Source)

at


org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAc
rossDRDA(Unknown

Source)

... 27 more

Caus

Re: Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread Peter Ondruška
Just a reminder to do backups and run the database with log archiving. 
Everything is built in Derby. I know for you it is too late for you :(

Peter

> On 10 Mar 2014, at 17:20, Myrna van Lunteren  wrote:
> 
> Although Derby has transaction control and a recovery mechanism, if a JVM 
> crashes or gets interrupted, the normal transaction steps might be 
> interrupted in unfortunate places, especially during compress. Was the 
> database shutdown before compress? Do you have a backup?
> 
> But perhaps there is something of use to you on this page:
> https://wiki.apache.org/db-derby/DatabaseCorruption
> 
> HTH
> Myrna
> 
> 
> 
>> On Mon, Mar 10, 2014 at 4:49 AM, Phil Bradley  wrote:
>> 
>> Hi,
>> 
>> I have a derby database that I am unable to connect to; when I try I get
>> "java.lang.ArrayIndexOutOfBoundsException". The full stack trace is
>> shown below.
>> 
>> Firstly, some background:
>> 
>> - I'm using derby 10.8.2.2 with a Java Webstart application that
>> connects in embedded mode. The clients are using Java 7u45 on Windows 7,
>> 32 bit
>> 
>> - The application is configured to run SYSCS_UTIL.SYSCS_COMPRESS_TABLE()
>> every 5 days on each table on startup
>> 
>> - The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a
>> particular table and based on the application logs, it looks like either
>> the JVM crashed or the application was ended via task manager.
>> 
>> - On subsequent attempts to start the application, the client was unable
>> to connect to the database as per the stack trace below. I have made a
>> copy of the database and I get this error reliably on accessing the
>> copy.
>> 
>> I have two questions:
>> 
>> 1. Is there anything that I can do to recover from this kind of scenario
>> automatically?
>> 2. Is there any debugging or other investigation that I can do that will
>> help reduce the severity of this kind of problem?
>> 
>> Thanks,
>> Phil
>> 
>> 
>> 
>> 
>> 
>> java.sql.SQLException: Failed to start database
>> 'C:\Users\Administrator\.myapp\myapp_db' with class loader
>> com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
>> details.
>> at
>> 
>> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
>> Source)
>> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
>> Source)
>> at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown
>> Source)
>> at
>> org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
>> Source)
>> at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown
>> Source)
>> at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown
>> Source)
>> at org.apache.derby.impl.jdbc.EmbedConnection40.(Unknown
>> Source)
>> at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
>> Source)
>> at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
>> at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown
>> Source)
>> at java.sql.DriverManager.getConnection(Unknown Source)
>> at java.sql.DriverManager.getConnection(Unknown Source)
>> at
>> 
>> com.mycompany.database.DbInitializer.runScript(DbInitializer.java:143)
>> at
>> 
>> com.mycompany.myapp.ApplicationRunner.initialiseDb(ApplicationRunner.java:817)
>> at
>> 
>> com.mycompany.myapp.ApplicationRunner.startApplication(ApplicationRunner.java:945)
>> at
>> com.mycompany.myapp.ApplicationRunner.run(ApplicationRunner.java:581)
>> at
>> 
>> com.mycompany.myapp.ApplicationRunner.main(ApplicationRunner.java:552)
>> at
>> com.mycompany.myapp.ApplicationLoader.main(ApplicationLoader.java:90)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at com.sun.javaws.Launcher.executeApplication(Unknown Source)
>> at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
>> at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
>> at com.sun.javaws.Launcher.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.sql.SQLException: Failed to start database
>> 'C:\Users\Administrator\.myapp\myapp_db' with class loader
>> com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
>> details.
>> at
>> 
>> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
>> Source)
>> at
>> 
>> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
>> Source)
>> ... 27 more
>> Caused by: java.sql.SQLException: Java exception: ':
>> java.lang.ArrayIndexOutOfBoundsException'.
>>   

Re: deleting a corrupted database with invalid checksum on page

2014-03-10 Thread Myrna van Lunteren
Perhaps there is something that can help you on this page:
https://wiki.apache.org/db-derby/DatabaseCorruption

HTH
Myrna


On Mon, Mar 10, 2014 at 8:18 AM, EagleS  wrote:

> I can't do rename table either unfortunately. Whatever query I try to run
> I get the same error and hex dump.
>
> - Reply message -
> From: "Bryan Pendleton-3 [via Apache Database]" <[hidden 
> email]
> >
> To: "EagleS" <[hidden 
> email]
> >
> Subject: deleting a corrupted database with invalid checksum on page
> Date: Mon, Mar 10, 2014 14:55
>
> > What can I do to just delete this table and then rebuild it from the
> Mirror
> > file?
>
> Can you use RENAME TABLE?
>
> Then you can create your new table with the old name, and just
> leave that old, damaged table around.
>
> Of course, you'll want to arrange a more long-term solution,
> but that might get you back on your feet again while you
> build a more solid overall plan.
>
> bryan
>
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-database.10148.n7.nabble.com/deleting-a-corrupted-database-with-invalid-checksum-on-page-tp137773p137789.html
>  To unsubscribe from deleting a corrupted database with invalid checksum
> on page, click here.
> NAML
>
> --
> View this message in context: Re: deleting a corrupted database with
> invalid checksum on 
> page
>
> Sent from the Apache Derby Users mailing list 
> archiveat
>  Nabble.com.
>


Re: Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread Myrna van Lunteren
Although Derby has transaction control and a recovery mechanism, if a JVM
crashes or gets interrupted, the normal transaction steps might be
interrupted in unfortunate places, especially during compress. Was the
database shutdown before compress? Do you have a backup?

But perhaps there is something of use to you on this page:
https://wiki.apache.org/db-derby/DatabaseCorruption

HTH
Myrna



On Mon, Mar 10, 2014 at 4:49 AM, Phil Bradley  wrote:

>
> Hi,
>
> I have a derby database that I am unable to connect to; when I try I get
> "java.lang.ArrayIndexOutOfBoundsException". The full stack trace is
> shown below.
>
> Firstly, some background:
>
> - I'm using derby 10.8.2.2 with a Java Webstart application that
> connects in embedded mode. The clients are using Java 7u45 on Windows 7,
> 32 bit
>
> - The application is configured to run SYSCS_UTIL.SYSCS_COMPRESS_TABLE()
> every 5 days on each table on startup
>
> - The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a
> particular table and based on the application logs, it looks like either
> the JVM crashed or the application was ended via task manager.
>
> - On subsequent attempts to start the application, the client was unable
> to connect to the database as per the stack trace below. I have made a
> copy of the database and I get this error reliably on accessing the
> copy.
>
> I have two questions:
>
> 1. Is there anything that I can do to recover from this kind of scenario
> automatically?
> 2. Is there any debugging or other investigation that I can do that will
> help reduce the severity of this kind of problem?
>
> Thanks,
> Phil
>
>
>
>
>
> java.sql.SQLException: Failed to start database
> 'C:\Users\Administrator\.myapp\myapp_db' with class loader
> com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
> details.
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
> Source)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
> Source)
> at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown
> Source)
> at
> org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
> Source)
> at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown
> Source)
> at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown
> Source)
> at org.apache.derby.impl.jdbc.EmbedConnection40.(Unknown
> Source)
> at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
> Source)
> at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
> at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown
> Source)
> at java.sql.DriverManager.getConnection(Unknown Source)
> at java.sql.DriverManager.getConnection(Unknown Source)
> at
>
> com.mycompany.database.DbInitializer.runScript(DbInitializer.java:143)
> at
>
> com.mycompany.myapp.ApplicationRunner.initialiseDb(ApplicationRunner.java:817)
> at
>
> com.mycompany.myapp.ApplicationRunner.startApplication(ApplicationRunner.java:945)
> at
>
> com.mycompany.myapp.ApplicationRunner.run(ApplicationRunner.java:581)
> at
>
> com.mycompany.myapp.ApplicationRunner.main(ApplicationRunner.java:552)
> at
>
> com.mycompany.myapp.ApplicationLoader.main(ApplicationLoader.java:90)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
> at com.sun.javaws.Launcher.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.sql.SQLException: Failed to start database
> 'C:\Users\Administrator\.myapp\myapp_db' with class loader
> com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
> details.
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> Source)
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
> Source)
> ... 27 more
> Caused by: java.sql.SQLException: Java exception: ':
> java.lang.ArrayIndexOutOfBoundsException'.
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> Source)
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
> Source)
> at
>
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
> Source)
> at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
> Source)
> at o

Re: deleting a corrupted database with invalid checksum on page

2014-03-10 Thread EagleS
I can't do rename table either unfortunately. Whatever query I try to run I get 
the same error and hex dump.

- Reply message -
From: "Bryan Pendleton-3 [via Apache Database]" 

To: "EagleS" 
Subject: deleting a corrupted database with invalid checksum on page
Date: Mon, Mar 10, 2014 14:55

> What can I do to just delete this table and then rebuild it from the Mirror
> file?
Can you use RENAME TABLE?
Then you can create your new table with the old name, and just
leave that old, damaged table around.
Of course, you'll want to arrange a more long-term solution,
but that might get you back on your feet again while you
build a more solid overall plan.
bryan









If you reply to this email, your message will be added to the discussion below:

http://apache-database.10148.n7.nabble.com/deleting-a-corrupted-database-with-invalid-checksum-on-page-tp137773p137789.html




To unsubscribe from deleting a corrupted database with invalid checksum on 
page, click here.
NAML



--
View this message in context: 
http://apache-database.10148.n7.nabble.com/deleting-a-corrupted-database-with-invalid-checksum-on-page-tp137773p137791.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: deleting a corrupted database with invalid checksum on page

2014-03-10 Thread Bryan Pendleton

What can I do to just delete this table and then rebuild it from the Mirror
file?


Can you use RENAME TABLE?

Then you can create your new table with the old name, and just
leave that old, damaged table around.

Of course, you'll want to arrange a more long-term solution,
but that might get you back on your feet again while you
build a more solid overall plan.

bryan



Corrupt database: ArrayIndexOutOfBoundsException on connect

2014-03-10 Thread Phil Bradley

Hi, 

I have a derby database that I am unable to connect to; when I try I get
"java.lang.ArrayIndexOutOfBoundsException". The full stack trace is
shown below. 

Firstly, some background:

- I'm using derby 10.8.2.2 with a Java Webstart application that
connects in embedded mode. The clients are using Java 7u45 on Windows 7,
32 bit

- The application is configured to run SYSCS_UTIL.SYSCS_COMPRESS_TABLE()
every 5 days on each table on startup

- The client was running SYSCS_UTIL.SYSCS_COMPRESS_TABLE() on a
particular table and based on the application logs, it looks like either
the JVM crashed or the application was ended via task manager. 

- On subsequent attempts to start the application, the client was unable
to connect to the database as per the stack trace below. I have made a
copy of the database and I get this error reliably on accessing the
copy. 

I have two questions:

1. Is there anything that I can do to recover from this kind of scenario
automatically? 
2. Is there any debugging or other investigation that I can do that will
help reduce the severity of this kind of problem? 

Thanks,
Phil





java.sql.SQLException: Failed to start database
'C:\Users\Administrator\.myapp\myapp_db' with class loader
com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.(Unknown
Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown
Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
com.mycompany.database.DbInitializer.runScript(DbInitializer.java:143)
at

com.mycompany.myapp.ApplicationRunner.initialiseDb(ApplicationRunner.java:817)
at

com.mycompany.myapp.ApplicationRunner.startApplication(ApplicationRunner.java:945)
at
com.mycompany.myapp.ApplicationRunner.run(ApplicationRunner.java:581)
at
com.mycompany.myapp.ApplicationRunner.main(ApplicationRunner.java:552)
at
com.mycompany.myapp.ApplicationLoader.main(ApplicationLoader.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Failed to start database
'C:\Users\Administrator\.myapp\myapp_db' with class loader
com.sun.jnlp.JNLPClassLoader@1bef5e8, see the next exception for
details.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at

org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
... 27 more
Caused by: java.sql.SQLException: Java exception: ':
java.lang.ArrayIndexOutOfBoundsException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at

org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
... 24 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at
org.apache.derby.impl.store.raw.data.AllocPage.ReadContainerInfo(Unknown
Source)
at
org.apache.derby.impl.store.raw.data.FileContainer.readHeader(Unknown
Source)
at org.apache.derby.impl.store.raw.data.RAFContainer.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at
or

deleting a corrupted database with invalid checksum on page

2014-03-10 Thread EagleS
Hi,

I have a database table POS_RESOURCES.RESOURCES that has been corrupted.
There is a Mirror file to this so easy to recreate it but I am unable to
delete it due to the corruption.

Whatever I try and do to the table I get them same result of:

SQLState:  08006
ErrorCode: 4
Error: DERBY SQL error: SQLCODE: -1, SQLSTATE: XSDG2, SQLERRMC: Invalid
checksum on Page Page(0,Container(0, 474144)), expected=229,350,622, on-disk
version=1,888,684,690, page dump follows: Hex dump:
: 0076  0001    93b4   .v..モᄡ..
0010:  0006        
0020:   0001       
And the hex dump continues for ages.

What can I do to just delete this table and then rebuild it from the Mirror
file? 

Thanks.



--
View this message in context: 
http://apache-database.10148.n7.nabble.com/deleting-a-corrupted-database-with-invalid-checksum-on-page-tp137773.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.