WSO2 Data Services Server (v3.0.1) を使用していますが、custom-datasources.xml で定義された特定のデータソースを JNDI に自動的に (コンソール管理を使用せずに) 登録できるかどうか疑問に思っていました。
私はこの構成でそれを達成しようとしました:
<datasource>
<name>IPL_DS_IDB</name>
<description>My custom datasource</description>
<jndiConfig>
<name>IPL_DS_DB</name>
<environment>
<property name="jndi.use.data.source.factory">true</property>
<property name="java.naming.factory.initial">com.sun.jndi.rmi.registry.RegistryContextFactory</property>
<property name="java.naming.provider.url">rmi://localhost:10002</property>
</environment>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://192.168.1.5:3306/idb</url>
<username>wso2user_idb</username>
<password>XXXXXXX</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
しかし、この構成で Data Services サーバーを起動すると、次の例外が発生します。
TID: [0] [DSS] [2013-07-17 12:00:27,671] ERROR {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Error in registering data source: IPL_DS_IDB - RegistryContext: object to bind must be Remote, Reference, or Referenceable {org.wso2.carbon.ndatasource.core.DataSourceRepository}
java.lang.IllegalArgumentException: RegistryContext: object to bind must be Remote, Reference, or Referenceable
at com.sun.jndi.rmi.registry.RegistryContext.encodeObject(RegistryContext.java:439)
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:157)
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:164)
at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.rebind(CarbonContextDataHolder.java:1046)
at javax.naming.InitialContext.rebind(InitialContext.java:427)
at org.wso2.carbon.ndatasource.core.DataSourceRepository.registerJNDI(DataSourceRepository.java:260)
at org.wso2.carbon.ndatasource.core.DataSourceRepository.registerDataSource(DataSourceRepository.java:360)
at org.wso2.carbon.ndatasource.core.DataSourceRepository.addDataSource(DataSourceRepository.java:474)
at org.wso2.carbon.ndatasource.core.DataSourceManager.initSystemDataSource(DataSourceManager.java:182)
at org.wso2.carbon.ndatasource.core.DataSourceManager.initSystemDataSources(DataSourceManager.java:161)
at org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent.initSystemDataSources(DataSourceServiceComponent.java:166)
at org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent.setSecretCallbackHandlerService(DataSourceServiceComponent.java:152)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:367)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:430)
誰かが助けることができますか?