Wonder whether it is due to bundle load order.. Is there anyway to change
it..
[2014-11-13 17:32:04,594] INFO
{org.wso2.carbon.ml.dataset.DatasetServiceActivator} - Dataset service
started
[2014-11-13 17:32:04,596] INFO
{org.wso2.carbon.ml.model.ModelServiceActivator} - Model service started
[2014-11-13 17:32:04,597] INFO
{org.wso2.carbon.ml.project.mgt.ProjectManagementServiceActivator} -
Project management service started
[2014-11-13 17:32:04,597] INFO
{org.wso2.carbon.ml.project.mgt.ProjectManagementServiceActivator} - ML
Wizard URL : http://localhost:9763/mlUI
[2014-11-13 17:32:05,536] INFO
{org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager} - LDAP
connection created successfully in read-write mode
[2014-11-13 17:32:05,709] INFO
{org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Configured
Registry in 83ms
On Thu, Nov 13, 2014 at 4:59 PM, Lochana Menikarachchi <[email protected]>
wrote:
>
> Is it possible access a database within osgi bundle's start method?
>
> public void start(BundleContext context) throws Exception {
> ModelService modelService = new ModelService();
> context.registerService(ModelService.class.getName(),
> modelService, null);
>
> * MLAlgorithmConfiguration mlAlgorithmConfiguration = new
> MLAlgorithmConfiguration();
> mlAlgorithmConfiguration.loadMLAlgorithmConfigurations();*
> logger.info("Model service started");
> }
>
> loadMLConfigurations loads some default values to a database. Adding bold
> lettered lines throws following exception
>
> INFO {org.wso2.carbon.ml.dataset.DatasetServiceActivator} - Dataset
> service started
> [2014-11-13 16:48:49,589] ERROR {org.wso2.carbon.ml.model.DatabaseHandler}
> - An error occurred while connecting to database. Name [jdbc/WSO2ML_DB] is
> not bound in this Context. Unable to find [jdbc].
> javax.naming.NameNotFoundException: Name [jdbc/WSO2ML_DB] is not bound in
> this Context. Unable to find [jdbc].
> at org.apache.naming.NamingContext.lookup(NamingContext.java:819)
> at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
> at
> org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:705)
> at javax.naming.InitialContext.lookup(InitialContext.java:411)
> at
> org.wso2.carbon.ml.model.DatabaseHandler.getDatabaseHandler(DatabaseHandler.java:62)
>
> --
> Lochana Menikarachchi
> Senior Tech Lead
> WSO2 Inc.
>
--
Lochana Menikarachchi
Senior Tech Lead
WSO2 Inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev