Personalize
ADS

Error with derby script WSO2 Registry

Forums :

i try to configuring the WSO2 Registry with Apache Derby Database on UBUNTU

so when i run the script to create a tables into "ij  console" only see an errors

"run '/home/SOA/wso2registry/database-scripts/derby-complete.sql"

 

Versión ij 10.3

ij> connect 'jdbc:derby://localhost:1527/db;user=regadmin;password=regadmin;create=true';

ij> run '/home/SOA/wso2registry/database-scripts/derby-complete.sql';

ij> CREATE TABLE ARTIFACTS (AID INTEGER GENERATED ALWAYS AS IDENTITY,

                PATH VARCHAR (500) NOT NULL,

                MEDIA_TYPE VARCHAR (500),

                DIRECTORY INTEGER NOT NULL,

                STATE INTEGER,

                AUTHOR VARCHAR (500),

                CREATED_TIME TIMESTAMP,

                DESCRIPTION VARCHAR (10000),

                PRIMARY KEY (AID),

                UNIQUE(PATH));

t his Now si OK , BUT ON THE NEXT INSTRUCCION

SHOW TABLES;

i have a problem.. .  below  you can read it

 

 

into ij Console

ij> SHOW CONNECTIONS;

CONNECTION0* -  jdbc:derby://localhost:1527/db;create=true

* = conexión actual

ij> SHOW TABLES;

ERROR 08006: No hay suficientes datos mientras se lee desde la red - se esperaba un mínimo de 6 y sólo se han recibido -1 bytes.  La conexión se ha finalizado.

ij>

 

the conexion is ok but the command show tables have a wrong.

 

IN ENGLISH

ERROR 08006: Not enough data while reading from the network - was expected at least 6 and have received only -1 bytes. The connection has been completed.

 

 

Can you please attach the

Can you please attach the derby.log file here.

I have tried to recreate

I have tried to recreate this error on same enviroment with derby derby-10.3.2.1, Script file run successfully and no errors appeared. Can you please double check your derby environment settings.

Derby-log

 

this is the Derby.Log :

 

Servidor de red Apache Derby - 10.3.2.1 - (599110) se ha iniciado y está listo para aceptar conexiones en el puerto 1527 a las 2008-04-22 19:07:13.092 GMT

----------------------------------------------------------------

2008-04-22 19:10:39.025 GMT:

 Arrancando Derby versión The Apache Software Foundation - Apache Derby - 10.3.2.1 - (599110): instancia c013800d-0119-7788-52e7-ffffc46a5449

en el directorio de base de datos /home/SOA/Derby-10/bin/dbreg 



Cargador de clases de base de datos iniciado - derby.database.classpath=''

 

 

Actually I can not read

Actually I can not read spanish, So I had to use google translator to read the deby log. There are no error messages loged in the file. Thus I can not say what is the exact reason causing this problem. Can you assing write premission to your database directory and check again.

dblook & Sysinfo FILES

THIS IS THE  dblook.log file

java.sql.SQLException: No suitable driver

    at java.sql.DriverManager.getConnection(DriverManager.java:545)

    at java.sql.DriverManager.getConnection(DriverManager.java:193)

    at org.apache.derby.tools.dblook.go(Unknown Source)

    at org.apache.derby.tools.dblook.<init>(Unknown Source)

    at org.apache.derby.tools.dblook.main(Unknown Source)

-- **--> DEBUG: No suitable driver

***********************************************************

SYSINFO FILE 

 

MyMachine@MyMachine-desktop:~/SOA/Derby-10/bin$ sh sysinfo

----------------- Información de Java ----------------

Versión de Java:     1.5.0

Proveedor de Java:   Free Software Foundation, Inc.

Inicio Java:         /usr/lib/jvm/java-1.5.0-gcj-4.2-1.5.0.0/jre

Classpath de Java:   /home/MyMachine/SOA/Derby-10/lib/derby.jar:/home/MyMachine/SOA/Derby-10/lib/derbynet.jar:/home/MyMachine/SOA/Derby-10/lib/derbytools.jar:/home/MyMachine/SOA/Derby-10/lib/derbyclient.jar:/home/MyMachine/SOA/Derby-10/lib/derby.jar:/home/MyMachine/SOA/Derby-10/lib/derbytools.jar:

Nombre del SO:       Linux

Arquitectura del SO: i386

Versión del SO:      2.6.22-14-generic

Nombre usuario Java: MyMachine

Dir. inicial usuario:/home/MyMachine

Dir. usuario:        /home/MyMachine/SOA/Derby-10/bin

java.specification.name: Java(tm) Platform API Specification

java.specification.version: 1.5

--------- Información de Derby --------

JRE - JDBC: J2SE 5.0 - JDBC 3.0

[/home/MyMachine/SOA/Derby-10/lib/derby.jar] 10.3.2.1 - (599110)

[/home/MyMachine/SOA/Derby-10/lib/derbytools.jar] 10.3.2.1 - (599110)

[/home/MyMachine/SOA/Derby-10/lib/derbynet.jar] 10.3.2.1 - (599110)

[/home/MyMachine/SOA/Derby-10/lib/derbyclient.jar] 10.3.2.1 - (599110)

------------------------------------------------------

-------------- Información de entorno local ----------

Entorno local actual:  [es/MX [es_MX]]

Se encontró soporte para el entorno local: [cs]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [de_DE]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [es]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [fr]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [hu]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [it]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [ja_JP]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [ko_KR]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [pl]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [pt_BR]

         versión: 10.3.2.1 - (599110)

Se encontró soporte para el entorno local: [ru]

         versión: 10.3.2.1 - (599110)

------------------------------------------------------

THE PROBLEM IJ CONSOLE IN ENGLISH

I configured my database DERBY   and the console the IJ no have problem. the problem is when i try to show tables o insert adata into my tables.

MyMachine@MyMachine-desktop:~/SOA/Derby-10/bin$ sh ij

Versión ij 10.3

ij> connect 'jdbc:derby://localhost:1527/dbreg3';   --> here is ok.



ij> create table mytabletest (clave int);

0 filas insertadas/actualizadas/suprimidas    --> here is ok too



ij> insert into mytabletest values (12);   --> here the PROBLEM

Not enough data while reading from the network - was expected at least 6 and have received only -1 bytes. The connection has been completed.

ij> 

This seems to be a derby

This seems to be a derby specific issue. Can you please ask this from derby team.

Derby & Tomcat now is working ... but

Ok , i installed a other version of Derby DB y now is working fine.

ij> show tables;

TABLE_SCHEM         |TABLE_NAME                    |REMARKS            

------------------------------------------------------------------------

.....

......

......

REGADMIN            |UM_ROLE_ATTRIBUTES            |                   

REGADMIN            |UM_ROLE_PERMISSIONS           |                   

REGADMIN            |UM_USERS                      |                   

REGADMIN            |UM_USER_ATTRIBUTES            |                   

REGADMIN            |UM_USER_PERMISSIONS           |                   

REGADMIN            |UM_USER_ROLES                 |                   

REGADMIN            |VERSIONS                      |                   



36 filas seleccionadas

ij> 

I configured de tomcat 6 with database derby , i put  the Wso2Registry in webapp. i copied .jar files into wso2registry . I run the startNetwork file and have no problem .

 

So.  when a type http://localhost:8090/wso2registry

I dont see anything  in the firefox navigator , and i check the terminal where i run the starNetwork file , i can see this message :

[ERROR] 708568 Could not check authentication.

Caused by Null Realm not permitted.

org.wso2.usermanager.UserManagerException: Null Realm not permitted.

 

what else i have to do ? , thank you for the help.

 

 

 

If you are using derby

If you are using derby embedded driver for connection then change it to client driver and check again. After the changes derby db config in your registry.xml should be as below.

<dbconfig name="derby-db">

    <url>jdbc:derby://localhost:1527//path/to/your/registrydb</url>

    <userName>userName</userName>

    <password>password</password>

    <driverName>org.apache.derby.jdbc.ClientDriver</driverName>

</dbconfig>

The Servet/wso2registry throw a exception

i changed the registry.xml  on 2 ways and any work :

1-

<dbconfig name="derby-db">

<url>jdbc:derby:/home/SOA/dbDerby/bin/db</url>

    <userName>userName</userName>

    <password>password</password>   

<driverName>org.apache.derby.jdbc.ClientDriver</driverName>

</dbconfig>

2-

<dbconfig name="derby-db">

 

    <url>/home/SOA/dbDerby/bin/db</url>

 

    <userName>userName</userName>

 

    <password>password</password>

 

    <driverName>org.apache.derby.jdbc.ClientDriver</driverName>

 

</dbconfig>

 

And this is the message for the two options :

 

25/04/2008 11:30:44 AM org.apache.catalina.core.StandardContext loadOnStartup

GRAVE: The Servlet /wso2registry throw a exception of load()

java.sql.SQLException: No suitable driver

    at java.sql.DriverManager.getDriver(DriverManager.java:243)

    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)

    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

 

 

 

 

I think you haven't use the

I think you haven't use the connection url/protocol correclty. Refer to my previous comment. In your derby configaration the url should be as "<url>jdbc:derby://localhost:1527//path/to/your/registrydb</url>". And also make sure to add all the required derby jar files to registry lib as mentioned in the User guide.

Now Is working fine

Tank you so much , for the support , now is working fine , Only i need to restart the App into my Tomcat Server.