Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-11-03 Thread Supun Sethunga
Hi,

Is this resolved? We are getting the same error when trying to integrate a
product specific H2 database to the ML product (WSO2ML_DB). However,
inbuilt carbon H2 DB works fine. Error is thrown when the product (from UI)
tries to access the WSO2ML_DB.

Follow are the configurations did when adding the new database.

*module/distribution/pom.xml :*

   
Create-ML-Database
package

run



















and copy the created database by
module/distribution/src/mainassembly/bin.xml using the following segment.

target/database/WSO2ML_DB.h2.db

wso2ml-${pom.version}/repository/database
true
666


The database was exposed as JNDI and is added to the master-datasources.xml.

Thanks,
Supun

On Tue, Sep 2, 2014 at 11:34 AM, Ajith Vitharana  wrote:

>
>
>
> On Tue, Sep 2, 2014 at 6:54 AM, Amalka Subasinghe  wrote:
>
>> Hi Friszan,
>>
>> Here I got this error, when I try to start the APIM, just unzipping the
>> pack under module/distribution. Not while executing tests.
>>
>
> Please go and talk to AM team :) . Anyway this error can be due to few
> reasons.
>
> 1. This AM database create and package to the AM product while building
> the product. So you can look at the build log to find any errors.
> 2. Enable the H2 configurations in carbon.xml and access through the
>  browser.
> 3. Did we  upgrade the H2 version in GIT ?
> 4. Check whether the AM source is properly updated in GIT.
>
> Thanks
> Ajith.
>
>
>
>> Thanks
>> Amalka
>>
>>
>>
>> On Mon, Sep 1, 2014 at 11:10 PM, Firzhan Naqash  wrote:
>>
>>> Hi Amalka,
>>>
>>> Since you are trying to set up for automation test, have you turned on
>>> the filtering of maven-resources-plugin?
>>>
>>> If so that might be trying to modify the H2 database while APIM
>>> modifying it, thus leads to corruption.
>>>
>>> Can you check on it ?
>>>
>>>
>>> Regards,
>>> Firzhan
>>>
>>>
>>> On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe 
>>> wrote:
>>>
 ERROR - ApiMgtDAO Error while adding the API:
 org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the database
 org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
 "/home/amalka/amalkas/apim-packs/Untitled
 Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". Possible
 solution: use the recovery tool [90030-140]

 at
 org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
 at org.h2.message.DbException.get(DbException.java:167)
 at org.h2.message.DbException.get(DbException.java:144)
 at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
 at org.h2.store.PageStore.openExisting(PageStore.java:314)
 at org.h2.store.PageStore.open(PageStore.java:271)
 at org.h2.engine.Database.getPageStore(Database.java:2059)
 at org.h2.engine.Database.open(Database.java:534)
 at org.h2.engine.Database.openDatabase(Database.java:207)
 at org.h2.engine.Database.(Database.java:202)
 at org.h2.engine.Engine.openSession(Engine.java:56)
 at org.h2.engine.Engine.openSession(Engine.java:146)
 at org.h2.engine.Engine.getSession(Engine.java:125)
 at org.h2.engine.Session.createSession(Session.java:122)
 at
 org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
 at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
 at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
 at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
 at org.h2.Driver.connect(Driver.java:73)
 at
 org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
 at
 org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
 at
 org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
 at
 org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
 at
 org.wso2.carbon.apimgt

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-11-03 Thread Harsha Kumara
Hi Supun,

Remove the true and try again which sometime cause
to corrupt files.

Thanks,
Harsha

On Mon, Nov 3, 2014 at 6:13 PM, Supun Sethunga  wrote:

> Hi,
>
> Is this resolved? We are getting the same error when trying to integrate a
> product specific H2 database to the ML product (WSO2ML_DB). However,
> inbuilt carbon H2 DB works fine. Error is thrown when the product (from UI)
> tries to access the WSO2ML_DB.
>
> Follow are the configurations did when adding the new database.
>
> *module/distribution/pom.xml :*
>
>
> Create-ML-Database
> package
> 
> run
> 
> 
> 
> 
> 
> 
>  message="### Creating
> Machine Learner Database ##"/>
>  driver="org.h2.Driver"
>
> url="jdbc:h2:${basedir}/target/database/WSO2ML_DB"
> userid="wso2carbon"
> password="wso2carbon" autocommit="true"
> onerror="continue">
> 
> 
> 
>  file="${basedir}/src/main/resources/dbscripts/h2.sql"/>
> 
>  message="# END
> "/>
> 
> 
> 
>
>
> and copy the created database by
> module/distribution/src/mainassembly/bin.xml using the following segment.
> 
> target/database/WSO2ML_DB.h2.db
>
> wso2ml-${pom.version}/repository/database
> true
> 666
> 
>
> The database was exposed as JNDI and is added to the
> master-datasources.xml.
>
> Thanks,
> Supun
>
> On Tue, Sep 2, 2014 at 11:34 AM, Ajith Vitharana  wrote:
>
>>
>>
>>
>> On Tue, Sep 2, 2014 at 6:54 AM, Amalka Subasinghe 
>> wrote:
>>
>>> Hi Friszan,
>>>
>>> Here I got this error, when I try to start the APIM, just unzipping the
>>> pack under module/distribution. Not while executing tests.
>>>
>>
>> Please go and talk to AM team :) . Anyway this error can be due to few
>> reasons.
>>
>> 1. This AM database create and package to the AM product while building
>> the product. So you can look at the build log to find any errors.
>> 2. Enable the H2 configurations in carbon.xml and access through the
>>  browser.
>> 3. Did we  upgrade the H2 version in GIT ?
>> 4. Check whether the AM source is properly updated in GIT.
>>
>> Thanks
>> Ajith.
>>
>>
>>
>>> Thanks
>>> Amalka
>>>
>>>
>>>
>>> On Mon, Sep 1, 2014 at 11:10 PM, Firzhan Naqash 
>>> wrote:
>>>
 Hi Amalka,

 Since you are trying to set up for automation test, have you turned on
 the filtering of maven-resources-plugin?

 If so that might be trying to modify the H2 database while APIM
 modifying it, thus leads to corruption.

 Can you check on it ?


 Regards,
 Firzhan


 On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe 
 wrote:

> ERROR - ApiMgtDAO Error while adding the API:
> org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the
> database
> org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
> "/home/amalka/amalkas/apim-packs/Untitled
> Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". 
> Possible
> solution: use the recovery tool [90030-140]
>
> at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
> at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
> at org.h2.store.PageStore.openExisting(PageStore.java:314)
> at org.h2.store.PageStore.open(PageStore.java:271)
> at org.h2.engine.Database.getPageStore(Database.java:2059)
> at org.h2.engine.Database.open(Database.java:534)
> at org.h2.engine.Database.openDatabase(Database.java:207)
> at org.h2.engine.Database.(Database.java:202)
> at org.h2.engine.Engine.openSession(Engine.java:56)
> at org.h2.engine.Engine.openSession(Engine.java:146)
> at org.h2.engine.Engine.getSession(Engine.java:125)
> at org.h2.engine.Session.createSession(Session.java:122)
> at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
> at
> org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
> at org.h

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-11-03 Thread Supun Sethunga
Hi Harsha,

Yeah it did the trick. Thanks! :)

Regards,
Supun

On Mon, Nov 3, 2014 at 6:30 PM, Harsha Kumara  wrote:

> Hi Supun,
>
> Remove the true and try again which sometime cause
> to corrupt files.
>
> Thanks,
> Harsha
>
> On Mon, Nov 3, 2014 at 6:13 PM, Supun Sethunga  wrote:
>
>> Hi,
>>
>> Is this resolved? We are getting the same error when trying to integrate
>> a product specific H2 database to the ML product (WSO2ML_DB). However,
>> inbuilt carbon H2 DB works fine. Error is thrown when the product (from UI)
>> tries to access the WSO2ML_DB.
>>
>> Follow are the configurations did when adding the new database.
>>
>> *module/distribution/pom.xml :*
>>
>>
>> Create-ML-Database
>> package
>> 
>> run
>> 
>> 
>> 
>> 
>> > refid="maven.compile.classpath"/>
>> 
>> > message="### Creating
>> Machine Learner Database ##"/>
>> > driver="org.h2.Driver"
>>
>> url="jdbc:h2:${basedir}/target/database/WSO2ML_DB"
>> userid="wso2carbon"
>> password="wso2carbon" autocommit="true"
>> onerror="continue">
>> 
>> 
>> 
>> > file="${basedir}/src/main/resources/dbscripts/h2.sql"/>
>> 
>> > message="#
>> END "/>
>> 
>> 
>> 
>>
>>
>> and copy the created database by
>> module/distribution/src/mainassembly/bin.xml using the following segment.
>> 
>> target/database/WSO2ML_DB.h2.db
>>
>> wso2ml-${pom.version}/repository/database
>> true
>> 666
>> 
>>
>> The database was exposed as JNDI and is added to the
>> master-datasources.xml.
>>
>> Thanks,
>> Supun
>>
>> On Tue, Sep 2, 2014 at 11:34 AM, Ajith Vitharana  wrote:
>>
>>>
>>>
>>>
>>> On Tue, Sep 2, 2014 at 6:54 AM, Amalka Subasinghe 
>>> wrote:
>>>
 Hi Friszan,

 Here I got this error, when I try to start the APIM, just unzipping the
 pack under module/distribution. Not while executing tests.

>>>
>>> Please go and talk to AM team :) . Anyway this error can be due to few
>>> reasons.
>>>
>>> 1. This AM database create and package to the AM product while building
>>> the product. So you can look at the build log to find any errors.
>>> 2. Enable the H2 configurations in carbon.xml and access through the
>>>  browser.
>>> 3. Did we  upgrade the H2 version in GIT ?
>>> 4. Check whether the AM source is properly updated in GIT.
>>>
>>> Thanks
>>> Ajith.
>>>
>>>
>>>
 Thanks
 Amalka



 On Mon, Sep 1, 2014 at 11:10 PM, Firzhan Naqash 
 wrote:

> Hi Amalka,
>
> Since you are trying to set up for automation test, have you turned on
> the filtering of maven-resources-plugin?
>
> If so that might be trying to modify the H2 database while APIM
> modifying it, thus leads to corruption.
>
> Can you check on it ?
>
>
> Regards,
> Firzhan
>
>
> On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe 
> wrote:
>
>> ERROR - ApiMgtDAO Error while adding the API:
>> org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the
>> database
>> org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
>> "/home/amalka/amalkas/apim-packs/Untitled
>> Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". 
>> Possible
>> solution: use the recovery tool [90030-140]
>>
>> at
>> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>> at org.h2.message.DbException.get(DbException.java:144)
>> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>> at org.h2.store.PageStore.openExisting(PageStore.java:314)
>> at org.h2.store.PageStore.open(PageStore.java:271)
>> at org.h2.engine.Database.getPageStore(Database.java:2059)
>> at org.h2.engine.Database.open(Database.java:534)
>> at org.h2.engine.Database.openDatabase(Database.java:207)
>> at org.h2.engine.Database.(Database.java:202)
>> at org.h2.engine.Engine.openSession(Engine.java:56)
>> at org.h2.engine.Engine.openSession(Engine.java:146)
>> at org.h

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-08-25 Thread Abimaran Kugathasan
Hi Roshan,

Seems that DB file was correpted. Can you check WSO2AM_DB.trace.db file and
attached it here?


On Mon, Aug 25, 2014 at 4:15 PM, Roshan Wijesena  wrote:

> Hi Devs,
>
> I am keep getting below exception when I am trying to add a new API via
> publisher
>
> Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
> record:
> "/home/roshan/workspace/MIT/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db".
> Possible solution: use the recovery tool [90030-140]
>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>  at org.h2.store.PageStore.openExisting(PageStore.java:314)
> at org.h2.store.PageStore.open(PageStore.java:271)
>  at org.h2.engine.Database.getPageStore(Database.java:2059)
> at org.h2.engine.Database.open(Database.java:534)
>  at org.h2.engine.Database.openDatabase(Database.java:207)
> at org.h2.engine.Database.(Database.java:202)
>  at org.h2.engine.Engine.openSession(Engine.java:56)
> at org.h2.engine.Engine.openSession(Engine.java:146)
>  at org.h2.engine.Engine.getSession(Engine.java:125)
> at org.h2.engine.Session.createSession(Session.java:122)
>  at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>  at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>  at org.h2.Driver.connect(Driver.java:73)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>  at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>  at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>  at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
> at
> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>  at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4833)
> ... 66 more
>
> any one has idea why is this?
>
> Regards
> Roshan
>
>
> --
> Roshan Wijesena.
> Senior Software Engineer-WSO2 Inc.
> Mobile: *+94752126789*
> Email: ros...@wso2.com
> *WSO2, Inc. :** wso2.com *
> lean.enterprise.middleware.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks
Abimaran Kugathasan

Software Engineer | WSO2 Inc
Data & APIs Technologies Team
Mobile : +94 77 1708229


  
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-08-25 Thread Roshan Wijesena
Hi Danushka, Abimaran

Thanks for your responses..

I am trying to start up basic APIM setup  with built in  H2 database first
because we ship H2 database by default. I can understand the fact that DB
is corrupted, just curious why is getting corrupted every time that I am
going to start up the set up.

Regards
Roshan


On Mon, Aug 25, 2014 at 6:28 PM, Danushka Fernando 
wrote:

> Hi Roshan
>
> H2 dbs get corrupted some times. We are not recommending H2 in production
> deployments. So if you want to store some data please use mysql. And you
> can delete h2 dbs (under $CARBON_HOME/repository/database/) and start the
> server with -Dsetup option.
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
>
> On Mon, Aug 25, 2014 at 5:20 PM, Abimaran Kugathasan 
> wrote:
>
>> Hi Roshan,
>>
>> Seems that DB file was correpted. Can you check WSO2AM_DB.trace.db file
>> and attached it here?
>>
>>
>> On Mon, Aug 25, 2014 at 4:15 PM, Roshan Wijesena  wrote:
>>
>>> Hi Devs,
>>>
>>> I am keep getting below exception when I am trying to add a new API via
>>> publisher
>>>
>>> Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
>>> record:
>>> "/home/roshan/workspace/MIT/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db".
>>> Possible solution: use the recovery tool [90030-140]
>>>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>>> at org.h2.message.DbException.get(DbException.java:167)
>>>  at org.h2.message.DbException.get(DbException.java:144)
>>> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>>>  at org.h2.store.PageStore.openExisting(PageStore.java:314)
>>> at org.h2.store.PageStore.open(PageStore.java:271)
>>>  at org.h2.engine.Database.getPageStore(Database.java:2059)
>>> at org.h2.engine.Database.open(Database.java:534)
>>>  at org.h2.engine.Database.openDatabase(Database.java:207)
>>> at org.h2.engine.Database.(Database.java:202)
>>>  at org.h2.engine.Engine.openSession(Engine.java:56)
>>> at org.h2.engine.Engine.openSession(Engine.java:146)
>>>  at org.h2.engine.Engine.getSession(Engine.java:125)
>>> at org.h2.engine.Session.createSession(Session.java:122)
>>>  at
>>> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
>>> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>>>  at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
>>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>>>  at org.h2.Driver.connect(Driver.java:73)
>>> at
>>> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>>>  at
>>> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
>>> at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>>>  at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
>>> at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>>>  at
>>> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
>>> at
>>> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>>>  at
>>> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4833)
>>> ... 66 more
>>>
>>> any one has idea why is this?
>>>
>>> Regards
>>> Roshan
>>>
>>>
>>> --
>>> Roshan Wijesena.
>>> Senior Software Engineer-WSO2 Inc.
>>> Mobile: *+94752126789*
>>> Email: ros...@wso2.com
>>> *WSO2, Inc. :** wso2.com *
>>> lean.enterprise.middleware.
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>>
>> Software Engineer | WSO2 Inc
>> Data & APIs Technologies Team
>> Mobile : +94 77 1708229
>>
>> 
>> 
>>   
>> 
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
Roshan Wijesena.
Senior Software Engineer-WSO2 Inc.
Mobile: *+94752126789*
Email: ros...@wso2.com
*WSO2, Inc. :** wso2.com *
lean.enterprise.middleware.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-08-25 Thread Danushka Fernando
Hi Roshan

H2 dbs get corrupted some times. We are not recommending H2 in production
deployments. So if you want to store some data please use mysql. And you
can delete h2 dbs (under $CARBON_HOME/repository/database/) and start the
server with -Dsetup option.

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729


On Mon, Aug 25, 2014 at 5:20 PM, Abimaran Kugathasan 
wrote:

> Hi Roshan,
>
> Seems that DB file was correpted. Can you check WSO2AM_DB.trace.db file
> and attached it here?
>
>
> On Mon, Aug 25, 2014 at 4:15 PM, Roshan Wijesena  wrote:
>
>> Hi Devs,
>>
>> I am keep getting below exception when I am trying to add a new API via
>> publisher
>>
>> Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
>> record:
>> "/home/roshan/workspace/MIT/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db".
>> Possible solution: use the recovery tool [90030-140]
>>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>>  at org.h2.message.DbException.get(DbException.java:144)
>> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>>  at org.h2.store.PageStore.openExisting(PageStore.java:314)
>> at org.h2.store.PageStore.open(PageStore.java:271)
>>  at org.h2.engine.Database.getPageStore(Database.java:2059)
>> at org.h2.engine.Database.open(Database.java:534)
>>  at org.h2.engine.Database.openDatabase(Database.java:207)
>> at org.h2.engine.Database.(Database.java:202)
>>  at org.h2.engine.Engine.openSession(Engine.java:56)
>> at org.h2.engine.Engine.openSession(Engine.java:146)
>>  at org.h2.engine.Engine.getSession(Engine.java:125)
>> at org.h2.engine.Session.createSession(Session.java:122)
>>  at
>> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
>> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>>  at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>>  at org.h2.Driver.connect(Driver.java:73)
>> at
>> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>>  at
>> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
>> at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>>  at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
>> at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>>  at
>> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
>> at
>> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>>  at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4833)
>> ... 66 more
>>
>> any one has idea why is this?
>>
>> Regards
>> Roshan
>>
>>
>> --
>> Roshan Wijesena.
>> Senior Software Engineer-WSO2 Inc.
>> Mobile: *+94752126789*
>> Email: ros...@wso2.com
>> *WSO2, Inc. :** wso2.com *
>> lean.enterprise.middleware.
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thanks
> Abimaran Kugathasan
>
> Software Engineer | WSO2 Inc
> Data & APIs Technologies Team
> Mobile : +94 77 1708229
>
> 
> 
>   
> 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Amalka Subasinghe
Hi,

I'm also getting the same issue, any update on this?
we want to up the basic APIM setup with H2 database for test automation

Thanks
Amalka



On Mon, Aug 25, 2014 at 6:48 PM, Roshan Wijesena  wrote:

> Hi Danushka, Abimaran
>
> Thanks for your responses..
>
> I am trying to start up basic APIM setup  with built in  H2 database first
> because we ship H2 database by default. I can understand the fact that DB
> is corrupted, just curious why is getting corrupted every time that I am
> going to start up the set up.
>
> Regards
> Roshan
>
>
> On Mon, Aug 25, 2014 at 6:28 PM, Danushka Fernando 
> wrote:
>
>> Hi Roshan
>>
>> H2 dbs get corrupted some times. We are not recommending H2 in production
>> deployments. So if you want to store some data please use mysql. And you
>> can delete h2 dbs (under $CARBON_HOME/repository/database/) and start the
>> server with -Dsetup option.
>>
>> Thanks & Regards
>> Danushka Fernando
>> Software Engineer
>> WSO2 inc. http://wso2.com/
>> Mobile : +94716332729
>>
>>
>> On Mon, Aug 25, 2014 at 5:20 PM, Abimaran Kugathasan 
>> wrote:
>>
>>> Hi Roshan,
>>>
>>> Seems that DB file was correpted. Can you check WSO2AM_DB.trace.db file
>>> and attached it here?
>>>
>>>
>>> On Mon, Aug 25, 2014 at 4:15 PM, Roshan Wijesena 
>>> wrote:
>>>
 Hi Devs,

 I am keep getting below exception when I am trying to add a new API via
 publisher

 Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
 record:
 "/home/roshan/workspace/MIT/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db".
 Possible solution: use the recovery tool [90030-140]
  at
 org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
 at org.h2.message.DbException.get(DbException.java:167)
  at org.h2.message.DbException.get(DbException.java:144)
 at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
  at org.h2.store.PageStore.openExisting(PageStore.java:314)
 at org.h2.store.PageStore.open(PageStore.java:271)
  at org.h2.engine.Database.getPageStore(Database.java:2059)
 at org.h2.engine.Database.open(Database.java:534)
  at org.h2.engine.Database.openDatabase(Database.java:207)
 at org.h2.engine.Database.(Database.java:202)
  at org.h2.engine.Engine.openSession(Engine.java:56)
 at org.h2.engine.Engine.openSession(Engine.java:146)
  at org.h2.engine.Engine.getSession(Engine.java:125)
 at org.h2.engine.Session.createSession(Session.java:122)
  at
 org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
 at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
  at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
 at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
  at org.h2.Driver.connect(Driver.java:73)
 at
 org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
  at
 org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
  at
 org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
  at
 org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
 at
 org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
  at
 org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4833)
 ... 66 more

 any one has idea why is this?

 Regards
 Roshan


 --
 Roshan Wijesena.
 Senior Software Engineer-WSO2 Inc.
 Mobile: *+94752126789*
 Email: ros...@wso2.com
 *WSO2, Inc. :** wso2.com *
 lean.enterprise.middleware.

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Thanks
>>> Abimaran Kugathasan
>>>
>>> Software Engineer | WSO2 Inc
>>> Data & APIs Technologies Team
>>> Mobile : +94 77 1708229
>>>
>>> 
>>> 
>>>   
>>> 
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>
>
> --
> Roshan Wijesena.
> Senior Software Engineer-WSO2 Inc.
> Mobile: *+94752126789*
> Email: ros...@wso2.com
> *WSO2, Inc. :** wso2.com *
> lean.enterprise.middleware.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Amalka Subasinghe

Senior Software Engineer
WSO2 Inc.
Mobile: +94 77 9401267

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Ajith Vitharana
Please attach the complete error log.

-Ajith


On Mon, Sep 1, 2014 at 2:59 PM, Amalka Subasinghe  wrote:

> Hi,
>
> I'm also getting the same issue, any update on this?
> we want to up the basic APIM setup with H2 database for test automation
>
> Thanks
> Amalka
>
>
>
> On Mon, Aug 25, 2014 at 6:48 PM, Roshan Wijesena  wrote:
>
>> Hi Danushka, Abimaran
>>
>> Thanks for your responses..
>>
>> I am trying to start up basic APIM setup  with built in  H2 database
>> first because we ship H2 database by default. I can understand the fact
>> that DB is corrupted, just curious why is getting corrupted every time that
>> I am going to start up the set up.
>>
>> Regards
>> Roshan
>>
>>
>> On Mon, Aug 25, 2014 at 6:28 PM, Danushka Fernando 
>> wrote:
>>
>>> Hi Roshan
>>>
>>> H2 dbs get corrupted some times. We are not recommending H2 in
>>> production deployments. So if you want to store some data please use mysql.
>>> And you can delete h2 dbs (under $CARBON_HOME/repository/database/) and
>>> start the server with -Dsetup option.
>>>
>>> Thanks & Regards
>>> Danushka Fernando
>>> Software Engineer
>>> WSO2 inc. http://wso2.com/
>>> Mobile : +94716332729
>>>
>>>
>>> On Mon, Aug 25, 2014 at 5:20 PM, Abimaran Kugathasan 
>>> wrote:
>>>
 Hi Roshan,

 Seems that DB file was correpted. Can you check WSO2AM_DB.trace.db
 file and attached it here?


 On Mon, Aug 25, 2014 at 4:15 PM, Roshan Wijesena 
 wrote:

> Hi Devs,
>
> I am keep getting below exception when I am trying to add a new API
> via publisher
>
> Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
> record:
> "/home/roshan/workspace/MIT/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db".
> Possible solution: use the recovery tool [90030-140]
>  at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>  at org.h2.store.PageStore.openExisting(PageStore.java:314)
> at org.h2.store.PageStore.open(PageStore.java:271)
>  at org.h2.engine.Database.getPageStore(Database.java:2059)
> at org.h2.engine.Database.open(Database.java:534)
>  at org.h2.engine.Database.openDatabase(Database.java:207)
> at org.h2.engine.Database.(Database.java:202)
>  at org.h2.engine.Engine.openSession(Engine.java:56)
> at org.h2.engine.Engine.openSession(Engine.java:146)
>  at org.h2.engine.Engine.getSession(Engine.java:125)
> at org.h2.engine.Session.createSession(Session.java:122)
>  at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>  at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>  at org.h2.Driver.connect(Driver.java:73)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>  at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>  at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>  at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
> at
> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>  at
> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4833)
> ... 66 more
>
> any one has idea why is this?
>
> Regards
> Roshan
>
>
> --
> Roshan Wijesena.
> Senior Software Engineer-WSO2 Inc.
> Mobile: *+94752126789*
> Email: ros...@wso2.com
> *WSO2, Inc. :** wso2.com *
> lean.enterprise.middleware.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Thanks
 Abimaran Kugathasan

 Software Engineer | WSO2 Inc
 Data & APIs Technologies Team
 Mobile : +94 77 1708229

 
 
   
 


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>
>>
>> --
>> Roshan Wijesena.
>> Senior Software Engineer-WSO2 Inc.
>> Mobile: *+94752126789*
>> Email: ros...@wso2.com
>> *WSO2, Inc. :** wso2.com 

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Amalka Subasinghe
ERROR - ApiMgtDAO Error while adding the API:
org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the database
org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
"/home/amalka/amalkas/apim-packs/Untitled
Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". Possible
solution: use the recovery tool [90030-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
at org.h2.store.PageStore.openExisting(PageStore.java:314)
at org.h2.store.PageStore.open(PageStore.java:271)
at org.h2.engine.Database.getPageStore(Database.java:2059)
at org.h2.engine.Database.open(Database.java:534)
at org.h2.engine.Database.openDatabase(Database.java:207)
at org.h2.engine.Database.(Database.java:202)
at org.h2.engine.Engine.openSession(Engine.java:56)
at org.h2.engine.Engine.openSession(Engine.java:146)
at org.h2.engine.Engine.getSession(Engine.java:125)
at org.h2.engine.Session.createSession(Session.java:122)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
at org.h2.Driver.connect(Driver.java:73)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at
org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4847)
at
org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:383)
at
org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
at
org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:1200)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at
org.jaggeryjs.rhino.publisher.modules.api.c2._c_anonymous_7(/publisher/modules/api/add.jag:144)
at
org.jaggeryjs.rhino.publisher.modules.api.c2.call(/publisher/modules/api/add.jag)
at
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
at
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
at
org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:117)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_script_0(/publisher/site/blocks/item-add/ajax/add.jag:4)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
at
org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.exec(/publisher/site/blocks/item-add/ajax/add.jag)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Firzhan Naqash
Hi Amalka,

Since you are trying to set up for automation test, have you turned on the
filtering of maven-resources-plugin?

If so that might be trying to modify the H2 database while APIM modifying
it, thus leads to corruption.

Can you check on it ?


Regards,
Firzhan


On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe  wrote:

> ERROR - ApiMgtDAO Error while adding the API:
> org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the database
> org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
> "/home/amalka/amalkas/apim-packs/Untitled
> Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". Possible
> solution: use the recovery tool [90030-140]
>
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
> at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
> at org.h2.store.PageStore.openExisting(PageStore.java:314)
> at org.h2.store.PageStore.open(PageStore.java:271)
> at org.h2.engine.Database.getPageStore(Database.java:2059)
> at org.h2.engine.Database.open(Database.java:534)
> at org.h2.engine.Database.openDatabase(Database.java:207)
> at org.h2.engine.Database.(Database.java:202)
> at org.h2.engine.Engine.openSession(Engine.java:56)
> at org.h2.engine.Engine.openSession(Engine.java:146)
> at org.h2.engine.Engine.getSession(Engine.java:125)
> at org.h2.engine.Session.createSession(Session.java:122)
> at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
> at org.h2.Driver.connect(Driver.java:73)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
> at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
> at
> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
> at
> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4847)
> at
> org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:383)
> at
> org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
> at
> org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:1200)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
> at
> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
> at
> org.jaggeryjs.rhino.publisher.modules.api.c2._c_anonymous_7(/publisher/modules/api/add.jag:144)
> at
> org.jaggeryjs.rhino.publisher.modules.api.c2.call(/publisher/modules/api/add.jag)
> at
> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
> at
> org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
> at
> org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
> at
> org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
> at
> org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
> at
> org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
> at
> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
> at
> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:117)
> at
> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
> at
> org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
> at
> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_script_0(/publisher/site/blocks/item-add/ajax/add.jag:4)
> at
> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
> at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
> at
> org.mozilla.ja

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Amalka Subasinghe
Hi Friszan,

Here I got this error, when I try to start the APIM, just unzipping the
pack under module/distribution. Not while executing tests.

Thanks
Amalka



On Mon, Sep 1, 2014 at 11:10 PM, Firzhan Naqash  wrote:

> Hi Amalka,
>
> Since you are trying to set up for automation test, have you turned on the
> filtering of maven-resources-plugin?
>
> If so that might be trying to modify the H2 database while APIM modifying
> it, thus leads to corruption.
>
> Can you check on it ?
>
>
> Regards,
> Firzhan
>
>
> On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe  wrote:
>
>> ERROR - ApiMgtDAO Error while adding the API:
>> org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the database
>> org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
>> "/home/amalka/amalkas/apim-packs/Untitled
>> Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". Possible
>> solution: use the recovery tool [90030-140]
>>
>> at
>> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>> at org.h2.message.DbException.get(DbException.java:144)
>> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>> at org.h2.store.PageStore.openExisting(PageStore.java:314)
>> at org.h2.store.PageStore.open(PageStore.java:271)
>> at org.h2.engine.Database.getPageStore(Database.java:2059)
>> at org.h2.engine.Database.open(Database.java:534)
>> at org.h2.engine.Database.openDatabase(Database.java:207)
>> at org.h2.engine.Database.(Database.java:202)
>> at org.h2.engine.Engine.openSession(Engine.java:56)
>> at org.h2.engine.Engine.openSession(Engine.java:146)
>> at org.h2.engine.Engine.getSession(Engine.java:125)
>> at org.h2.engine.Session.createSession(Session.java:122)
>> at
>> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
>> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>> at org.h2.Driver.connect(Driver.java:73)
>> at
>> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>> at
>> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
>> at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>> at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
>> at
>> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>> at
>> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
>> at
>> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>> at
>> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4847)
>> at
>> org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:383)
>> at
>> org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
>> at
>> org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:1200)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>> at
>> org.jaggeryjs.rhino.publisher.modules.api.c2._c_anonymous_7(/publisher/modules/api/add.jag:144)
>> at
>> org.jaggeryjs.rhino.publisher.modules.api.c2.call(/publisher/modules/api/add.jag)
>> at
>> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
>> at
>> org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
>> at
>> org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>> at
>> org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymous_1(/publisher/modules/api/module.jag:5)
>> at
>> org.jaggeryjs.rhino.publisher.modules.api.c0.call(/publisher/modules/api/module.jag)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>> at
>> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0._c_anonymous_1(/publisher/site/blocks/item-add/ajax/add.jag:117)
>> at
>> org.jaggeryjs.rhino.publisher.site.blocks.item_add.ajax.c0.call(/publisher/site/blocks/item-add/ajax/add.jag)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
>> at
>> org.jaggeryjs.rh

Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record excception is throwing APIM GIT build while adding a new API.

2014-09-01 Thread Ajith Vitharana
On Tue, Sep 2, 2014 at 6:54 AM, Amalka Subasinghe  wrote:

> Hi Friszan,
>
> Here I got this error, when I try to start the APIM, just unzipping the
> pack under module/distribution. Not while executing tests.
>

Please go and talk to AM team :) . Anyway this error can be due to few
reasons.

1. This AM database create and package to the AM product while building the
product. So you can look at the build log to find any errors.
2. Enable the H2 configurations in carbon.xml and access through the
 browser.
3. Did we  upgrade the H2 version in GIT ?
4. Check whether the AM source is properly updated in GIT.

Thanks
Ajith.



> Thanks
> Amalka
>
>
>
> On Mon, Sep 1, 2014 at 11:10 PM, Firzhan Naqash  wrote:
>
>> Hi Amalka,
>>
>> Since you are trying to set up for automation test, have you turned on
>> the filtering of maven-resources-plugin?
>>
>> If so that might be trying to modify the H2 database while APIM modifying
>> it, thus leads to corruption.
>>
>> Can you check on it ?
>>
>>
>> Regards,
>> Firzhan
>>
>>
>> On Mon, Sep 1, 2014 at 3:34 PM, Amalka Subasinghe 
>> wrote:
>>
>>> ERROR - ApiMgtDAO Error while adding the API:
>>> org.wso2.carbon.apimgt.api.model.APIIdentifier@60ba6803 to the database
>>> org.h2.jdbc.JdbcSQLException: File corrupted while reading record:
>>> "/home/amalka/amalkas/apim-packs/Untitled
>>> Folder/wso2am-1.7.0-SNAPSHOT/repository/database/WSO2AM_DB.h2.db". Possible
>>> solution: use the recovery tool [90030-140]
>>>
>>> at
>>> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>>> at org.h2.message.DbException.get(DbException.java:167)
>>> at org.h2.message.DbException.get(DbException.java:144)
>>> at org.h2.store.PageStore.readVariableHeader(PageStore.java:699)
>>> at org.h2.store.PageStore.openExisting(PageStore.java:314)
>>> at org.h2.store.PageStore.open(PageStore.java:271)
>>> at org.h2.engine.Database.getPageStore(Database.java:2059)
>>> at org.h2.engine.Database.open(Database.java:534)
>>> at org.h2.engine.Database.openDatabase(Database.java:207)
>>> at org.h2.engine.Database.(Database.java:202)
>>> at org.h2.engine.Engine.openSession(Engine.java:56)
>>> at org.h2.engine.Engine.openSession(Engine.java:146)
>>> at org.h2.engine.Engine.getSession(Engine.java:125)
>>> at org.h2.engine.Session.createSession(Session.java:122)
>>> at
>>> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
>>> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
>>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
>>> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
>>> at org.h2.Driver.connect(Driver.java:73)
>>> at
>>> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
>>> at
>>> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
>>> at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
>>> at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
>>> at
>>> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
>>> at
>>> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
>>> at
>>> org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil.getConnection(APIMgtDBUtil.java:138)
>>> at
>>> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4847)
>>> at
>>> org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:383)
>>> at
>>> org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:45)
>>> at
>>> org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addAPI(APIProviderHostObject.java:1200)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
>>> at
>>> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
>>> at
>>> org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>>> at
>>> org.jaggeryjs.rhino.publisher.modules.api.c2._c_anonymous_7(/publisher/modules/api/add.jag:144)
>>> at
>>> org.jaggeryjs.rhino.publisher.modules.api.c2.call(/publisher/modules/api/add.jag)
>>> at
>>> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
>>> at
>>> org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
>>> at
>>> org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
>>> at
>>> org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>>> at
>>> org.jaggeryjs.rhino.publisher.modules.api.c0._c_anonymou