While rewriting parts of an application to make use of Hivemind I encountered a problem with a class implementing two interfacess. I realized that writing
<service-point id="id" interface="i1, i2">
does not work and thus combined both interfaces into a new interface. Now I have the following interface:


public interface PConnectionPoolDataSource extends javax.sql.ConnectionPoolDataSource, javax.sql.DataSource {
}


and a class implementing that interface.

In my hivemodule file I define a service point:

<service-point id="PersistenceConnectionPoolDataSource" interface="com.sdm.quasar.persistence.datasource.PConnectionPoolDataSource">
<invoke-factory service-id="hivemind.BuilderFactory">
<construct class="com.sdm.quasar.persistence.datasource.PersistenceConnectionPoolDataSource">
<string>jdbc:mysql://localhost/test</string>
<int>10</int>
<int>5</int>
</construct>
</invoke-factory>
</service-point>


When auto-wiring this service to another one, Hivemind crashes with
"Error at file:/Z:/workspace/qpersistence/bin/META-INF/hivemodule.xml, line 52, column 94: Unable to autowire property PConnectionPoolDataSource of service com.sdm.quasar.persistence.Configuration: Attempt to redefine method java.io.PrintWriter getLogWriter() throws java.sql.SQLException of class $SingletonProxy_fede57f89e_6." (complete trace below).


The problem seems to be, that both javax.sql.ConnectionPoolDataSource and javax.sql.DataSource define the same method "java.io.PrintWriter getLogWriter() throws java.sql.SQLException" and Hivemind seems to try to add that method to the proxy twice. Any way to work around this? I am using Hivemind 1.0-beta2.

Thanks for any help

Oliver Strutynski


+ + + complete trace + + +
org.apache.hivemind.ApplicationRuntimeException: Attempt to redefine method java.io.PrintWriter getLogWriter() throws java.sql.SQLException of class $SingletonProxy_fede57f89e_6.
at org.apache.hivemind.impl.servicemodel.SingletonServiceModel.createSingletonProxy(SingletonServiceModel.java:114)
at org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getService(SingletonServiceModel.java:58)
at org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:168)
at org.apache.hivemind.impl.ServicePointImpl.getService(ServicePointImpl.java:181)
at org.apache.hivemind.impl.RegistryImpl.getService(RegistryImpl.java:163)
at org.apache.hivemind.impl.ModuleImpl.getService(ModuleImpl.java:65)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.autowireProperty(BuilderFactoryLogic.java:301)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.autowireServices(BuilderFactoryLogic.java:275)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.setProperties(BuilderFactoryLogic.java:220)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.createService(BuilderFactoryLogic.java:70)
at org.apache.hivemind.service.impl.BuilderFactory.createCoreServiceImplementation(BuilderFactory.java:65)
at org.apache.hivemind.impl.InvokeFactoryServiceConstructor.constructCoreServiceImplementation(InvokeFactoryServiceConstructor.java:81)
at org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructCoreServiceImplementation(AbstractServiceModelImpl.java:100)
at org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(AbstractServiceModelImpl.java:148)
at org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructServiceImplementation(AbstractServiceModelImpl.java:130)
at org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualServiceImplementation(SingletonServiceModel.java:69)
at $InnerProxy_fede57f73f_5._service($InnerProxy_fede57f73f_5.java)
at $InnerProxy_fede57f73f_5.setup($InnerProxy_fede57f73f_5.java)
at $SingletonProxy_fede57f6c7_4.setup($SingletonProxy_fede57f6c7_4.java)
at com.sdm.quasartutorials.persistence.common.Configuration.<init>(Configuration.java:84)
at com.sdm.quasartutorials.persistence.createobjects.demo.CreateObjectsDemo.main(CreateObjectsDemo.java:32)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to