Win a copy of Head First Android this week in the Android forum!

Caesar Dutta

Ranch Hand
+ Follow
since Sep 18, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Caesar Dutta

I am writing this here as I see that I cannot post a topic in Books area.
This is about a book written by my manager Dr. Debasish Jana here at
PriceWaterhouseCoopers Ltd, Calcutta, India.

It is aimed more at the Object Oriented Techniques of Java and has a
very good treatise on Garbage Collection.

Java and Object-Oriented Programming Paradigm
Publishers: Prentice Hall of India

Dr. Jana has extensive experience in C/C++ programming and has authored
a book on C++.

It will be available by mid. May

Caesar
16 years ago
Dear Mr. Khan:

Thanks for sharing the URL. By going thru. the table of contents, I
understand that its a great one.

I am a SCJP and SCWCD and have exp. in EJBs with Weblogic. Could you
please let me know, that along with a J2ME book whether I require any
hardware resources.

Thanks very much in advance.

Caesar
16 years ago
Hi:

If poosible kindly let me know how to resolve this problem.

In Sun Java One Application Server, under Application Server > Java Message Service > Physical Destinations whenever I click on Physical
Destinations I am receiving the following error

"
A "com.sun.enterprise.tools.guiframework.exception.FrameworkError" was caught. The message from the exception: "Unable to get View for ViewDescriptor 'jmsPhysicalDestinations'"

The root cause is "com.sun.enterprise.admin.common.exception.JMSAdminException: [C4003]: Error occurred on connection creation [caesardutta:7676]. - cause: java.net.ConnectException: Connection refused: connect"

"

Please let me know what I should do. Yes there any service I need to start
at Port 7676

Thanks and regards,

Caesar
16 years ago
Hi:

If poosible kindly let me know how to resolve this problem.

In Sun Java One Application Server, under Application Server > Java Message Service > Physical Destinations whenever I click on Physical
Destinations I am receiving the following error

"
A "com.sun.enterprise.tools.guiframework.exception.FrameworkError" was caught. The message from the exception: "Unable to get View for ViewDescriptor 'jmsPhysicalDestinations'"

The root cause is "com.sun.enterprise.admin.common.exception.JMSAdminException: [C4003]: Error occurred on connection creation [caesardutta:7676]. - cause: java.net.ConnectException: Connection refused: connect"

"

Please let me know what I should do. Yes there any service I need to start
at Port 7676

Thanks and regards,

Caesar
16 years ago
Hi Arun:

Thanks so much. If you could recollect then kindly let me know the
steps. Since I am a VB developer, I find this Java technology
extremely difficult and confusing.

Best regards,

Caesar
16 years ago
Hi:

Can anyone suggest some website or simple code for how to integrate
Visual Basic with Java. For example if I want to invoke a java class
from a VB dll and pass some parameters.

One usual method would be Shell(java -options myclass parameters). But
in this method there is no way to have the returned parameter.

Any help would be greatly appreciated.

Caesar
16 years ago
I am using BEA Weblogic 8.1 with Oracle 9.2

Whenever I reboot my machine I find that the Connection pool created thru.
weblogic admin console is no more available. Also from the XP event log I
find the following error for the service "beasvc" :
SetServiceStatusFailed()!

Any help would be greatly appreciated.

Thanks Caesar
16 years ago
Hi,

Is there anyone who has used the simple container managed bean example
that comes with weblogic 8.1.0

I have not succeded in deploying that.

Thanks in advance -

Caesar
16 years ago
I have posted this in form Java > EJBs also
---------------------------------------------

Hi everybody:

I have followed the example AccountBean that comes with Bea Weblogic.

In the file "weblogic-cmp-rdbms-jar.xml" I have used the
JNDI name for Data Source for the tag "data-source-name.

For reference I giving below the xml files:-

ejb-jar.xml
------------
<?xml version="1.0"?>

<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>containerManaged</ejb-name>
<home>examples.ejb20.basic.containerManaged.AccountHome</home>
<remote>examples.ejb20.basic.containerManaged.Account</remote>
<ejb-class>examples.ejb20.basic.containerManaged.AccountBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AccountBean</abstract-schema-name>
<cmp-field>
<field-name>accountId</field-name>
</cmp-field>
<cmp-field>
<field-name>balance</field-name>
</cmp-field>
<cmp-field>
<field-name>accountType</field-name>
</cmp-field>
<primkey-field>accountId</primkey-field>
<query>
<query-method>
<method-name>findBigAccounts</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance > ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findAccount</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance = ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findNullAccounts</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.accountType IS NULL]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>containerManaged</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

weblogic-ejb-jar.xml
-----------------------
<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
"-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN"
"http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd" >


<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>containerManaged</ejb-name>

<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>

</entity-descriptor>

<jndi-name>ejb20-containerManaged-AccountHome</jndi-name>

</weblogic-enterprise-bean>

</weblogic-ejb-jar>

and weblogic-cmp-rdbms-jar.xml
--------------------------

<?xml version="1.0"?>

<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'>

<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>containerManaged</ejb-name>
<!- This is the datasource JNDI name -->
<data-source-name>Oracle9iPool</data-source-name>
<table-map>
<table-name>ejbAccounts</table-name>
<field-map>
<cmp-field>accountId</cmp-field>
<dbms-column>id</dbms-column>
</field-map>
<field-map>
<cmp-field>balance</cmp-field>
<dbms-column>bal</dbms-column>
</field-map>
<field-map>
<cmp-field>accountType</cmp-field>
<dbms-column>acctype</dbms-column>
</field-map>
</table-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>DropAndCreateAlways</create-default-dbms-tables>
</weblogic-rdbms-jar>

All the files are at /META-INF

When I am deploying the EAR file its giving a stack dump such as
"
Exception:weblogic.management.ApplicationException: activate failed for SimpleCMP.jar Module: SimpleCMP.jar Error: Exception activating module: EJBModule(SimpleCMP.jar,status=PREPARED) Unable to deploy EJB: containerManaged from SimpleCMP.jar: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start() failed on resource 'Oracle9iPool': XAER_RMERR : A resource manager error has occured in the transaction branch oracle.jdbc.xa.OracleXAException at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159) at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311) at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50) at weblogic.jdbc.jta.DataSource.start(DataSource.java:604) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069) at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001) at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203) at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419) at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193) at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyDatabaseType(RDBMSPersistenceManager.java:2025) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:195) at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:217) at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:184) at weblogic.ejb20.manager.DBManager.setup(DBManager.java:164) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1004) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1322) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610) at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3012) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2076) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2057) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2624) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2547) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2349) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2431) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2343) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2511) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

"

Kindly note that I have some Stateful/Stateless EJBs using these JDBC
services and the connection pool is tested too.

Any help would be greatly appreciated or if somebone can provide a step
by step simple example for CMP (not CMR now) I would be grateful.

Thanks in advance.

Caesar
16 years ago
Hi everybody:

I have followed the example AccountBean that comes with Bea Weblogic.

In the file "weblogic-cmp-rdbms-jar.xml" I have used the
JNDI name for Data Source for the tag "data-source-name.

For reference I giving below the xml files:-

ejb-jar.xml
------------
<?xml version="1.0"?>

<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>containerManaged</ejb-name>
<home>examples.ejb20.basic.containerManaged.AccountHome</home>
<remote>examples.ejb20.basic.containerManaged.Account</remote>
<ejb-class>examples.ejb20.basic.containerManaged.AccountBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AccountBean</abstract-schema-name>
<cmp-field>
<field-name>accountId</field-name>
</cmp-field>
<cmp-field>
<field-name>balance</field-name>
</cmp-field>
<cmp-field>
<field-name>accountType</field-name>
</cmp-field>
<primkey-field>accountId</primkey-field>
<query>
<query-method>
<method-name>findBigAccounts</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance > ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findAccount</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance = ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findNullAccounts</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.accountType IS NULL]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>containerManaged</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

weblogic-ejb-jar.xml
-----------------------
<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
"-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN"
"http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd" >


<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>containerManaged</ejb-name>

<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>

</entity-descriptor>

<jndi-name>ejb20-containerManaged-AccountHome</jndi-name>

</weblogic-enterprise-bean>

</weblogic-ejb-jar>

and weblogic-cmp-rdbms-jar.xml
--------------------------

<?xml version="1.0"?>

<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'>

<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>containerManaged</ejb-name>
<!- This is the datasource JNDI name -->
<data-source-name>Oracle9iPool</data-source-name>
<table-map>
<table-name>ejbAccounts</table-name>
<field-map>
<cmp-field>accountId</cmp-field>
<dbms-column>id</dbms-column>
</field-map>
<field-map>
<cmp-field>balance</cmp-field>
<dbms-column>bal</dbms-column>
</field-map>
<field-map>
<cmp-field>accountType</cmp-field>
<dbms-column>acctype</dbms-column>
</field-map>
</table-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>DropAndCreateAlways</create-default-dbms-tables>
</weblogic-rdbms-jar>

All the files are at /META-INF

When I am deploying the EAR file its giving a stack dump such as
"
Exception:weblogic.management.ApplicationException: activate failed for SimpleCMP.jar Module: SimpleCMP.jar Error: Exception activating module: EJBModule(SimpleCMP.jar,status=PREPARED) Unable to deploy EJB: containerManaged from SimpleCMP.jar: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start() failed on resource 'Oracle9iPool': XAER_RMERR : A resource manager error has occured in the transaction branch oracle.jdbc.xa.OracleXAException at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159) at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311) at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50) at weblogic.jdbc.jta.DataSource.start(DataSource.java:604) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069) at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001) at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203) at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419) at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193) at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyDatabaseType(RDBMSPersistenceManager.java:2025) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:195) at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:217) at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:184) at weblogic.ejb20.manager.DBManager.setup(DBManager.java:164) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1004) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1322) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610) at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3012) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2076) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2057) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2624) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2547) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2349) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2431) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2343) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2511) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

"

Kindly note that I have some Stateful/Stateless EJBs using these JDBC
services and the connection pool is tested too.

Any help would be greatly appreciated or if somebone can provide a step
by step simple example for CMP (not CMR now) I would be grateful.

Thanks in advance.

Caesar
Manish,

Your email id is Yahoo based. Moreover, in a forum you are asking for
Pune/Mumbai based candidates. I feel its quite strange. Are you a
home based recruiter?
16 years ago
Thanks Shailesh so much. I put 9000 and it worked.

Thanks again.
17 years ago
Hi,

My web application structure is as follows:

SendError {contains index.html, form.html}
|
|__WEB-INF {contains web.xml}
|
|_classes

index.html
-------------
<html><title>What is this</title>
<body>This is my body</body>
</html>

form.html
---------
<html>
<body>
This is an error page
<body>
</html>

web.xml
-------
<web-app>
<error-page>
<error-code>200</error-code>
<location>/form.html</location>
</error-page>

</web-app>

I am testing this in Sun Java Application Server, BeaWeblogic, and finally
Tomcat 5.0

If I take out the portion <error-page>...</error-page> from web to xml
then on http://localhost:85/SendError is giving the index .html.

But if I put the block back in web.xml the output is from form.html.

If anybody can help, on what is happening I will be very grateful.

Thanks,

Caesar
17 years ago
I would like to thank everybody for their nice explanation and taking the
time.

Warm regards,

Caesar
17 years ago
First I should say that the explanation of Instance/Static initializer
was very helpful

Quote
The JVM starts up, the class Foo is loaded, and its main() method is executed.
End Quote

That means whenver the class gets loaded its main() method gets
executed. But a class may not have a main method. I am now confused.

Suppose C is a class

What is the difference bewteen
1) C c = new C() and
2) forName(C)

My understanding is 1) - Load and initialize and for 2) I do not know...

I have seen in JDBC that
try {
Class.forName(("oracle.jdbc.driver.OracleDriver");
}catch(Exception e) {
System.out.println("Error = " + e.getMessage());
}

Then I use DriverManager.getConnection()

I do not write
DriverManager d = Class.forName(("oracle.jdbc.driver.OracleDriver");
and then
d.getConnection(required parameters.)

All these things are confusing me.

Caesar
17 years ago