I have 2 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());
}
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user