You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/07/12 13:09:20 UTC

Basic Questions

Hello there! I've just started with hivemind. I'm using 1.1 Beta 2
with Tapestry 4 Beta 2. I have this service configured:
<module id="TCRUD" version="0.1.0" package="com.cs.tapestry">
	<service-point id="myDataSource" interface="javax.sql.DataSource">
   		<invoke-factory model="singleton">
			   <construct class="org.apache.commons.dbcp.BasicDataSource">
				   <set property="driverClassName" value="com.mysql.jdbc.Driver"/>
				   <set property="url" value="jdbc:mysql://localhost/test"/>
				   <set property="username" value="root"/>
				   <set property="password" value=""/>
				   <set property="defaultAutoCommit" value="false"/>
				   <set property="maxActive" value="10"/>
				   <set property="initialSize" value="5"/>
			   </construct>
		   </invoke-factory>
	</service-point>
	<service-point id="myConnection" interface="java.sql.Connection">
    <invoke-factory service-id="hivetranse.jdbc.ConnectionFactory"
model="singleton">
        <datasource id="myDataSource"/>
    </invoke-factory>

</service-point>
</module>

When starting the application on tomcat 5.5.9 I get this:

org.apache.hivemind.ApplicationRuntimeException: Error at
jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar!/META-INF/hivemodule.xml,
line 13, column 34: Module hivetranse.jdbc has contributed a instance
builder to service point hivetranse.core.TransactionService, which
conflicts with an existing contribution by module
hivetranse.hibernate3. The duplicate contribution has been ignored.
   location: jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar!/META-INF/hivemodule.xml,
line 13, column 34

Duplicate contribution? Didn't quite get this...
I'm using hiveutils 0.5 as well. And when question I have is. To
configure an Hibernate 3 session, the docs says that in order to get a
sessionFactory working we need a hibernate.cfg.xml, but it does not
point where do we make a reference for it on our hivemind module. Does
anyone has an example?

Regards

Vinicius Carvalho

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Basic Questions

Posted by Vinicius Carvalho <ja...@gmail.com>.
ok, sorry, please ignore my last question ;)

On 7/12/05, Vinicius Carvalho <ja...@gmail.com> wrote:
> Hello there! I've just started with hivemind. I'm using 1.1 Beta 2
> with Tapestry 4 Beta 2. I have this service configured:
> <module id="TCRUD" version="0.1.0" package="com.cs.tapestry">
>         <service-point id="myDataSource" interface="javax.sql.DataSource">
>                 <invoke-factory model="singleton">
>                            <construct class="org.apache.commons.dbcp.BasicDataSource">
>                                    <set property="driverClassName" value="com.mysql.jdbc.Driver"/>
>                                    <set property="url" value="jdbc:mysql://localhost/test"/>
>                                    <set property="username" value="root"/>
>                                    <set property="password" value=""/>
>                                    <set property="defaultAutoCommit" value="false"/>
>                                    <set property="maxActive" value="10"/>
>                                    <set property="initialSize" value="5"/>
>                            </construct>
>                    </invoke-factory>
>         </service-point>
>         <service-point id="myConnection" interface="java.sql.Connection">
>     <invoke-factory service-id="hivetranse.jdbc.ConnectionFactory"
> model="singleton">
>         <datasource id="myDataSource"/>
>     </invoke-factory>
> 
> </service-point>
> </module>
> 
> When starting the application on tomcat 5.5.9 I get this:
> 
> org.apache.hivemind.ApplicationRuntimeException: Error at
> jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar!/META-INF/hivemodule.xml,
> line 13, column 34: Module hivetranse.jdbc has contributed a instance
> builder to service point hivetranse.core.TransactionService, which
> conflicts with an existing contribution by module
> hivetranse.hibernate3. The duplicate contribution has been ignored.
>    location: jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar!/META-INF/hivemodule.xml,
> line 13, column 34
> 
> Duplicate contribution? Didn't quite get this...
> I'm using hiveutils 0.5 as well. And when question I have is. To
> configure an Hibernate 3 session, the docs says that in order to get a
> sessionFactory working we need a hibernate.cfg.xml, but it does not
> point where do we make a reference for it on our hivemind module. Does
> anyone has an example?
> 
> Regards
> 
> Vinicius Carvalho
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Basic Questions

Posted by Jean-Francois Poilpret <jf...@hcm.vnn.vn>.
Hello Vinicius,

First off, the problem you describe is related to HiveMind Utilities
project, not HiveMind itself, hence you should not ask this question in this
forum but on SourceForge;-)

However, since the answer is "quite" straightforward, I will do it here
(however if you have further questions or problems related to HiveMind
Utilities, please do not ask them here, I am afraid readers of this list
might get bored of questions which are not fully related to HiveMind).

The duplicate contribution error comes from the fact you have put both
hivetranse.jdbc.jar and hivetranse.hibernate3.jar. These jars are exclusive:
you must not try to use them simultaneously in the same application (I know
this is not explicitly described in the doc, I will try to add it when I
have time). Hence you must choose if you want JDBC Connections injected into
your services OR Hibernate Sessions, but not both (please note that it is
easy to get a Connection from a Hibernate Session however), and hence put
only the chosen jar in your WEB-INF/lib.

About the hibernate.cfg.xml, in the QuickStart web page, it is said that
hibernate3 configuration is the same as hibernate2, in hibernate2
configuration example, you have this sample declaration:

<service-point id="MySession" interface="net.sf.hibernate.Session">
    <invoke-factory service-id="hivetranse.hibernate.SessionFactory" 
			model="singleton">
        <config file="hibernate-config.xml"/>
    </invoke-factory>
</service-point>

You just need to replace net.sf.hibernate.Session with org.hibernate.Session
and hivetranse.hibernate.SessionFactory with
hivetranse.hibernate3.SessionFactory.

The "hibernate-config.xml" name is the name of the hibernate config file
that must be in the META-INF directory of the jar where you defined this
configuration (same location as your hivemodule.xml). Please note it can be
any other name.

You can also check the hivemodule.xml file of the hibernate3.example module
(part of HiveMind Utilities distribution).

Hope this helps

	Jean-Francois


-----Original Message-----
From: Vinicius Carvalho [mailto:java.vinicius@gmail.com] 
Sent: Tuesday, July 12, 2005 6:09 PM
To: hivemind-user@jakarta.apache.org
Subject: Basic Questions

Hello there! I've just started with hivemind. I'm using 1.1 Beta 2
with Tapestry 4 Beta 2. I have this service configured:
<module id="TCRUD" version="0.1.0" package="com.cs.tapestry">
	<service-point id="myDataSource" interface="javax.sql.DataSource">
   		<invoke-factory model="singleton">
			   <construct
class="org.apache.commons.dbcp.BasicDataSource">
				   <set property="driverClassName"
value="com.mysql.jdbc.Driver"/>
				   <set property="url"
value="jdbc:mysql://localhost/test"/>
				   <set property="username" value="root"/>
				   <set property="password" value=""/>
				   <set property="defaultAutoCommit"
value="false"/>
				   <set property="maxActive" value="10"/>
				   <set property="initialSize" value="5"/>
			   </construct>
		   </invoke-factory>
	</service-point>
	<service-point id="myConnection" interface="java.sql.Connection">
    <invoke-factory service-id="hivetranse.jdbc.ConnectionFactory"
model="singleton">
        <datasource id="myDataSource"/>
    </invoke-factory>

</service-point>
</module>

When starting the application on tomcat 5.5.9 I get this:

org.apache.hivemind.ApplicationRuntimeException: Error at
jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar
!/META-INF/hivemodule.xml,
line 13, column 34: Module hivetranse.jdbc has contributed a instance
builder to service point hivetranse.core.TransactionService, which
conflicts with an existing contribution by module
hivetranse.hibernate3. The duplicate contribution has been ignored.
   location:
jar:file:/C:/java/tomcat-5.5.9/webapps/tcrud/WEB-INF/lib/hivetranse.jdbc.jar
!/META-INF/hivemodule.xml,
line 13, column 34

Duplicate contribution? Didn't quite get this...
I'm using hiveutils 0.5 as well. And when question I have is. To
configure an Hibernate 3 session, the docs says that in order to get a
sessionFactory working we need a hibernate.cfg.xml, but it does not
point where do we make a reference for it on our hivemind module. Does
anyone has an example?

Regards

Vinicius Carvalho

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org