Roman, you are asking a user question and should do that on jboss-user
discussion group,
the jboss-development are the for developers of the jboss product
Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Roman
> Brouk
> Sent: Wednesday, April 25, 2001 4:34 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] Connection Pool - Help!
>
>
> i have to apologize for my ignorance, but isn't it discussion newsgroup?
> if not sorry. and may be you can direct me somewhere else to some other
> newsgroup
>
> thank you,
> -roman
>
>
> Please advise who can we consult on the following issues:
>
> we have 3 questions that need to be resolve using JBOSS server:
>
> 1. For some reason jndi lookup is not finding entity beans
> consistently,
> although jboss server on the start-up says "[Container factory] Deploying
> CustomerHistory".
>
> For example, we do have an entry in ejb-jar.xml with:
> <entity>
> <ejb-name>CustomerHistory</ejb-name>
> <home>com.cogenia.server.entities.CustomerHistoryHome</home>
>
> <remote>com.cogenia.server.entities.CustomerHistoryRemote</remote>
>
> <ejb-class>com.cogenia.server.entities.CustomerHistoryEntityBean</
> ejb-class>
> <persistence-type>Bean</persistence-type>
>
> <prim-key-class>com.cogenia.server.entities.CustomerHistoryPrimKey
> </prim-key
> -class>
> <reentrant>False</reentrant>
> </entity>
>
> Sometimes jndi is able to located, sometimes it doesn't.
>
> the java code used to do a lookup is as follows:
>
> Object ref = null;
> try {
> System.setProperty("java.naming.factory.initial",
> "org.jnp.interfaces.NamingContextFactory");
> System.setProperty("java.naming.provider.url", "localhost");
> InitialContext jndiContext = new InitialContext();
> ref = jndiContext.lookup("CustomerHistory");
> }catch(Exception e)
> { //ERROR OCCURES HERE!!}
>
>
> ------------------------------------------------------------------
> ----------
> --------------------
> 2.
>
> We have entity bean persistance. Is transaction support only works if
> connection pool is
> used? What are the correct steps to bound connection. We followed
> everything in the spec.
> We have mySQL database. When jboss started it says "[MySQLDB] XA
> Connection pool MySQLDB bound to java:/MySQLDB" but when JNDI
> lookup is used
> in java to locate connection pool with name "java:/MySQLDB" we
> get the error
> of the poolname not beeing bound.
>
> here is what we did:
>
> in jboss.properties i added:
> jdbc.drivers=org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver
>
> in jboss.conf i added:
> <MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
> CODEBASE="../../lib/ext/">
> <ARG TYPE="java.lang.String" VALUE="MySQLDB">
> <ARG TYPE="java.lang.String"
> VALUE="org.jboss.minerva.xa.XADataSourceImpl">
> </MLET>
>
> in jboss.jcml i added (notice that PoolName and DataSourceClass
> is missing.
> for some reason
> although i add poolname as an attribute it will be deleted when i start up
> jboss):
> <server>
> <mbean name="DefaultDomain:service=XADataSource,name=MySQLDB">
> <attribute name="GCMinIdleTime">1200000</attribute>
> <attribute name="JDBCUser" />
> <attribute name="MaxSize">0</attribute>
> <attribute name="Password" />
> <attribute name="URL">jdbc:mysql://localhost/CogeniaDB</attribute>
> <attribute name="GCEnabled">false</attribute>
> <attribute name="InvalidateOnError">false</attribute>
> <attribute name="TimestampUsed">false</attribute>
> <attribute name="Blocking">true</attribute>
> <attribute name="GCInterval">120000</attribute>
> <attribute name="IdleTimeout">1800000</attribute>
> <attribute name="IdleTimeoutEnabled">false</attribute>
> <attribute name="LoggingEnabled">false</attribute>
> <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
> <attribute name="MinSize">0</attribute>
> <attribute name="Properties"></attribute>
> </mbean>
>
> in Java to do a JNDI lookup we have:
>
> Connection con = null;
> try{
> InitialContext jndiContext = new InitialContext();
> javax.sql.DataSource ds = (javax.sql.DataSource)
> jndiContext.lookup("java:/MySQLDB");
> con = ds.getConnection();
> }catch(javax.naming.NamingException exne)
> {
> //ERROR OCCURES HERE!!
> System.out.println("*** " + exne.getMessage());
> }
>
> ------------------------------------------------------------------
> ----------
> --------------------
> 3. Will transaction work if we get connection from DriverManager? How
> exactly do you support transactions?
>
>
>
> Thank you for you responce and help.
>
> -Roman Brouk
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of marc
> fleury
> Sent: Wednesday, April 25, 2001 3:58 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] Connection Pool - Help!
>
>
> DO NOT ANSWER JBOSS-USER ON THIS LIST
>
> marc
>
>
> |-----Original Message-----
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of Filip
> |Hanik
> |Sent: Wednesday, April 25, 2001 6:15 PM
> |To: [EMAIL PROTECTED]
> |Subject: RE: [JBoss-dev] Connection Pool - Help!
> |
> |
> |it is the deployment descriptor
> |http://www.jboss.org/documentation/HTML/ch01s10.html
> |
> |Filip
> |
> |~
> |Namaste - I bow to the divine in you
> |~
> |Filip Hanik
> |Software Architect
> |[EMAIL PROTECTED]
> |www.filip.net
> |
> |> -----Original Message-----
> |> From: [EMAIL PROTECTED]
> |> [mailto:[EMAIL PROTECTED]]On
> Behalf Of Roman
> |> Brouk
> |> Sent: Wednesday, April 25, 2001 2:13 PM
> |> To: [EMAIL PROTECTED]
> |> Subject: RE: [JBoss-dev] Connection Pool - Help!
> |>
> |>
> |> thanks for the responce Filip...
> |>
> |> but i am not using jboss.xml. Should i be?
> |> If i should be where should it reside on my file system and
> what besides:
> |>
> |> <resource-managers>
> |> <resource-manager res-class="">
> |> <res-name>MySQLDB</res-name>
> |> <res-jndi-name>MySQLDB</res-jndi-name>
> |> </resource-manager>
> |> </resource-managers>
> |>
> |> should be in this file?
> |>
> |> -----Original Message-----
> |> From: [EMAIL PROTECTED]
> |> [mailto:[EMAIL PROTECTED]]On
> Behalf Of Filip
> |> Hanik
> |> Sent: Wednesday, April 25, 2001 1:52 PM
> |> To: [EMAIL PROTECTED]
> |> Subject: RE: [JBoss-dev] Connection Pool - Help!
> |>
> |>
> |> go through the archives, there was a change made - this is a copy
> |> of one of
> |> the emails
> |>
> |> A change will be required if you have a res-jndi-name element in your
> |> jboss.xml
> |> descriptor that is relying on the implied java:/ prefix being
> added. For
> |> example if
> |> your using:
> |> <resource-managers>
> |> <resource-manager res-class="">
> |> <res-name>DefaultDS</res-name>
> |> <res-jndi-name>DefaultDS</res-jndi-name>
> |> </resource-manager>
> |> </resource-managers>
> |>
> |> rather than:
> |> <resource-managers>
> |> <resource-manager res-class="">
> |> <res-name>DefaultDS</res-name>
> |> <res-jndi-name>java:/DefaultDS</res-jndi-name>
> |> </resource-manager>
> |> </resource-managers>
> |>
> |> the descriptor will be broken.
> |>
> |> ~
> |> Namaste - I bow to the divine in you
> |> ~
> |> Filip Hanik
> |> Software Architect
> |> [EMAIL PROTECTED]
> |> www.filip.net
> |>
> |> > -----Original Message-----
> |> > From: [EMAIL PROTECTED]
> |> > [mailto:[EMAIL PROTECTED]]On
> |Behalf Of Roman
> |> > Brouk
> |> > Sent: Wednesday, April 25, 2001 1:42 PM
> |> > To: [EMAIL PROTECTED]
> |> > Subject: RE: [JBoss-dev] Connection Pool - Help!
> |> >
> |> >
> |> > oh... sorry i forgot to add i am not using CMP, i am aquiring
> |> > connection in
> |> > every entity bean with the following code in JAVA:
> |> > Connection con = null;
> |> > try{
> |> > InitialContext jndiContext = new InitialContext();
> |> > javax.sql.DataSource ds = (javax.sql.DataSource)
> |> > jndiContext.lookup("java:/MySQLDB");
> |> > con = ds.getConnection();
> |> > }catch(javax.naming.NamingException exne)
> |> > {
> |> > System.out.println("*** " + exne.getMessage());
> |> > }
> |> >
> |> >
> |> > -----Original Message-----
> |> > From: [EMAIL PROTECTED]
> |> > [mailto:[EMAIL PROTECTED]]On
> |Behalf Of Roman
> |> > Brouk
> |> > Sent: Wednesday, April 25, 2001 11:56 AM
> |> > To: [EMAIL PROTECTED]
> |> > Subject: [JBoss-dev] Connection Pool - Help!
> |> >
> |> >
> |> > Hello all,
> |> >
> |> > If anyone had this problem please help! I have to use
> |connection pool in
> |> > jboss in order to use Transactions(is that right?). I am using Java
> |> > context.lookup to locate my connection pool(java:/MySQLDB) and
> |i get the
> |> > error of the poolname not beeing bound although when i start
> |up jboss it
> |> > says "[MySQLDB] XA Connection pool MySQLDB bound to java:/MySQLDB".
> |> >
> |> > I am using mySQL database.
> |> > here is what i did:
> |> >
> |> > in jboss.properties i added:
> |> > jdbc.drivers=org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver
> |> >
> |> > in jaws file i added:
> |> > <jaws>
> |> > <datasource>MySQLDB</datasource>
> |> > <type-mapping>mySQL</type-mapping>
> |> > </jaws>
> |> >
> |> > in jboss.conf i added:
> |> > <MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
> |> > CODEBASE="../../lib/ext/">
> |> > <ARG TYPE="java.lang.String" VALUE="MySQLDB">
> |> > <ARG TYPE="java.lang.String"
> |> > VALUE="org.jboss.minerva.xa.XADataSourceImpl">
> |> > </MLET>
> |> >
> |> > in jboss.jcml i added (notice that PoolName is missing. for
> some reason
> |> > although i add poolname as an attribute it will be deleted when
> |> i start up
> |> > jboss):
> |> > <server>
> |> > <mbean name="DefaultDomain:service=XADataSource,name=MySQLDB">
> |> > <attribute name="GCMinIdleTime">1200000</attribute>
> |> > <attribute name="JDBCUser" />
> |> > <attribute name="MaxSize">0</attribute>
> |> > <attribute name="Password" />
> |> > <attribute
> |> name="URL">jdbc:mysql://localhost/CogeniaDB</attribute>
> |> > <attribute name="GCEnabled">false</attribute>
> |> > <attribute name="InvalidateOnError">false</attribute>
> |> > <attribute name="TimestampUsed">false</attribute>
> |> > <attribute name="Blocking">true</attribute>
> |> > <attribute name="GCInterval">120000</attribute>
> |> > <attribute name="IdleTimeout">1800000</attribute>
> |> > <attribute name="IdleTimeoutEnabled">false</attribute>
> |> > <attribute name="LoggingEnabled">false</attribute>
> |> > <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
> |> > <attribute name="MinSize">0</attribute>
> |> > <attribute name="Properties"></attribute>
> |> > </mbean>
> |> >
> |> >
> |> > _______________________________________________
> |> > Jboss-development mailing list
> |> > [EMAIL PROTECTED]
> |> > http://lists.sourceforge.net/lists/listinfo/jboss-development
> |> >
> |> >
> |> > _______________________________________________
> |> > Jboss-development mailing list
> |> > [EMAIL PROTECTED]
> |> > http://lists.sourceforge.net/lists/listinfo/jboss-development
> |> >
> |>
> |>
> |> _______________________________________________
> |> Jboss-development mailing list
> |> [EMAIL PROTECTED]
> |> http://lists.sourceforge.net/lists/listinfo/jboss-development
> |>
> |>
> |> _______________________________________________
> |> Jboss-development mailing list
> |> [EMAIL PROTECTED]
> |> http://lists.sourceforge.net/lists/listinfo/jboss-development
> |>
> |
> |
> |_______________________________________________
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |http://lists.sourceforge.net/lists/listinfo/jboss-development
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development