[Registry-dev] Embedded registry initialization
Chathura C. Ekanayake
chathura at wso2.com
Wed Apr 23 21:30:38 PDT 2008
Hi Keith,
AID (Artifact ID) column in all the tables is renamed to RID (Resource ID).
Thanks,
Chathura
Keith Chapman wrote:
> I tried and fixed SQLs to some extent. But I cannot find the equivalent
> for the following.
>
> SELECT A.PATH FROM RESOURCE A, TAG T WHERE A.PATH=? AND T.TAG_NAME=? AND
> T.AID=A.AID AND T.USER_ID=? AND (A.MEDIA_TYPE='wso2_mashup' OR
> A.MEDIA_TYPE='wso2_data_service')
>
> Neither the TAGS table nor the RESOURCE table has a column called AID.
>
> What is the solution for this?
>
> Thanks,
> Keith.
>
> Keith Chapman wrote:
>
>> Hi,
>>
>> It looks like You've done database schema changes too and now our SQL's
>> are throwing errors and the Mashup Server does not start. For e.g
>>
>> 1. The ARTIFACTS table does not exist. I thought the RESOURCE table
>> substituted it.
>>
>> 2. The ARTIFACTS table had a column called STATE, non of the new tables
>> have this column
>>
>> So basically we have to go through all our SQLs and figure out whats wrong.
>>
>> What are the changes you have done to the schema?
>>
>> Thanks,
>> Keith.
>>
>> Chathura C. Ekanayake wrote:
>>
>>> Hi Keith,
>>>
>>> I updated the Derby database scripts for the new resource store data model.
>>> I checked the Derby database with the Registry webapp and it works fine.
>>> Mashup Server should also work with the updated scripts.
>>>
>>> Thanks,
>>> Chathura
>>>
>>> Keith Chapman wrote:
>>>
>>>> Hi Chathura,
>>>>
>>>> I updated the Mashup Server to incorporate these changes. It builds
>>>> right but unfortunately fails to start reporting the error above. The
>>>> above occurs when performing
>>>> EmbeddedRegistry embeddedRegistry = new EmbeddedRegistry(datasource,
>>>> realm);
>>>>
>>>> This looks like a registry Bug. Did you forget to update any derby
>>>> database scripts?
>>>>
>>>> Failed to check the existence of the resource /. Table 'RESOURCE' does
>>>> not exist.
>>>> ERROR 42X05: Table 'RESOURCE' does not exist.
>>>> at
>>>> org.apache.derby.iapi.error.StandardException.newException(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown
>>>>
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown
>>>> Source)
>>>> at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)
>>>> at org.apache.derby.impl.sql.compile.ReadCursorNode.bind(Unknown
>>>> Source)
>>>> at org.apache.derby.impl.sql.compile.CursorNode.bind(Unknown
>>>> Source)
>>>> at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown
>>>> Source)
>>>> at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
>>>>
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
>>>> at
>>>> org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source)
>>>> at
>>>> org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown
>>>> Source)
>>>> at
>>>> org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown
>>>> Source)
>>>> at
>>>> org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:248)
>>>>
>>>> at
>>>> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:302)
>>>>
>>>> at
>>>> org.wso2.registry.jdbc.dao.ResourceDAO.resourceExists(ResourceDAO.java:186)
>>>>
>>>> at
>>>> org.wso2.registry.jdbc.JDBCRegistry.addRootCollection(JDBCRegistry.java:627)
>>>>
>>>> at
>>>> org.wso2.registry.jdbc.JDBCRegistry.init(JDBCRegistry.java:167)
>>>> at
>>>> org.wso2.registry.jdbc.JDBCRegistry.<init>(JDBCRegistry.java:113)
>>>> at
>>>> org.wso2.registry.jdbc.EmbeddedRegistry.<init>(EmbeddedRegistry.java:43)
>>>> at
>>>> org.wso2.mashup.deployer.JSDeployer.initRegistry(JSDeployer.java:1038)
>>>> at org.wso2.mashup.deployer.JSDeployer.init(JSDeployer.java:151)
>>>> at
>>>> org.apache.axis2.deployment.DeploymentEngine.initializeDeployers(DeploymentEngine.java:928)
>>>>
>>>> at
>>>> org.apache.axis2.deployment.DeploymentEngine.setConfigContext(DeploymentEngine.java:919)
>>>>
>>>> at
>>>> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:76)
>>>>
>>>> at
>>>> org.wso2.utils.WSO2ConfigurationContextFactory.createNewConfigurationContext(WSO2ConfigurationContextFactory.java:60)
>>>>
>>>> at org.wso2.wsas.ServerManager.start(ServerManager.java:107)
>>>> at org.wso2.wsas.MainServlet.start(MainServlet.java:249)
>>>> at
>>>> org.wso2.mashup.transport.MainServlet.start(MainServlet.java:37)
>>>> at org.wso2.wsas.MainServlet.init(MainServlet.java:185)
>>>> at
>>>> org.wso2.mashup.transport.MainServlet.init(MainServlet.java:52)
>>>> at
>>>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
>>>> at
>>>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3915)
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4176)
>>>> at
>>>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
>>>>
>>>> at
>>>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
>>>> at
>>>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
>>>> at
>>>> org.wso2.wsas.TomcatRepositoryListener.run(TomcatRepositoryListener.java:107)
>>>>
>>>> at java.lang.Thread.run(Thread.java:595)
>>>>
>>>> Thanks,
>>>> keith.
>>>>
>>>> Chathura C. Ekanayake wrote:
>>>>
>>>>
>>>>> Now all the authorizations of the registry are performed by the
>>>>> components responsible for actual operations. So the SecureRegistry is
>>>>> no longer required. Now all the operations are authorized and the
>>>>> registry cannot be directly accessed through the JDBCRegistry. If an
>>>>> application doesn't want to care about managing users, it can access the
>>>>> registry as the system user. Creating registries for users is simplified
>>>>> by the EmbeddedRegistry.
>>>>>
>>>>> Below are the steps for creating the EmbeddedRegistry and then obtaining
>>>>> user registries from it.
>>>>>
>>>>> EmbeddedRegistry embeddedRegistry = new EmbeddedRegistry(datasource);
>>>>>
>>>>> // get the system registry
>>>>> Registry systemRegistry = embeddedRegistry.getSystemRegistry();
>>>>>
>>>>> // get an anonymous user registry
>>>>> Registry systemRegistry = embeddedRegistry.getRegistry();
>>>>>
>>>>> // get the user registry for the user "username"
>>>>> Registry userRegistry1 = embeddedRegistry.getUserRegistry("username",
>>>>> "password");
>>>>>
>>>>> In the above sample, the user realm for the registry is automatically
>>>>> created from the same data source, where registry database is located.
>>>>> If it is necessary to use a different realm, below constructor can be
>>>>> used.
>>>>>
>>>>> EmbeddedRegistry embeddedRegistry = new EmbeddedRegistry(datasource,
>>>>> realm);
>>>>>
>>>>> Below constructor can be used to create registry from an in-memory
>>>>> database.
>>>>>
>>>>> EmbeddedRegistry embeddedRegistry = new InMemoryEmbeddedRegistry();
>>>>>
>>>>> Thanks,
>>>>> Chathura
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Registry-dev mailing list
>>>>> Registry-dev at wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Registry-dev mailing list
>>>> Registry-dev at wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>>>
>>>>
>>>>
>> _______________________________________________
>> Registry-dev mailing list
>> Registry-dev at wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>
>>
>
>
> _______________________________________________
> Registry-dev mailing list
> Registry-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>
>
More information about the Registry-dev
mailing list