Win a copy of AWS Security this week in the Cloud/Virtualization forum!

clement valentine

+ Follow
since Apr 04, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by clement valentine

Hi guys,
Iam not using the Sun's FSContext but the Sonic's jndi. I have added the following sonic jars to the wls classpath:
@rem Add the Sonic JMS Provider
set SONICMQ_CLASSPATH=%SONICMQ_LIB%\mfcontext.jar;%SONICMQ_LIB%\sonic_Client.jar;%SONICMQ_LIB%\sonic_ASPI.jar;%SONICMQ_LIB%\sonic_XA.jar;%SONICMQ_LIB%\sonic_Selector.jar;%SONICMQ_LIB%\sonic_Crypto.jar;%SONICMQ_LIB%\jndi.jar

This is my foreign JMS server configuration in WLS console
JNDI Initial Context Factory: com.sonicsw.jndi.mfcontext.MFContextFactory
JNDI Provider URL: tcp://localhost:2506
JNDI Properties:

This is the snippet from WLS config.xml
<ForeignJMSServer ConnectionURL="tcp://localhost:2506";
JNDIProperties="java.naming.provider.url=tcp://localhost:2506;java.naming.factory.initial=com.sonicsw.jndi.mfcontext.MFContextFactory;com.sonicsw.jndi.mfcontext.idleTimeout=6000;com.sonicsw.jndi.mfcontext.domain=Domain1" Name="WLSSONIC">
<ForeignJMSConnectionFactory LocalJNDIName="jms/QCF"
RemoteJNDIName="SonicMQQueueConnectionFactory" Username="Administrator"/>
<ForeignJMSDestination LocalJNDIName="jms/SampleQ1"
Name="SonicMQSampleQ1" RemoteJNDIName="SonicMQSampleQ1"/>


Thanks guys
Hello all,
Iam trying to get an MDB on WLS to listen to a Sonic MQ installation. Iam using Sonic's built in JNDI and have made the necessary setting under Foreign JMS server under Weblogic console (I followed the code share available on Sonic's site!). But the MDB always starts with the following warning and does not listen to the Q.

<Jan 9, 2006 11:47:07 PM CST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: SonicMDB is unable to connect to the JMS destination: jms/SampleQ1. The Error was:
[EJB:011010]The JMS destination with the JNDI name: jms/SampleQ1 could not be found. Please ensure that the JNDI name in the weblogic-ejb-jar.xml is correct, and the JMS destination has been deployed.>

This is my weblogic-ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "">;

I have configured the jndi name for the destination and connection factory correctly under the console.. Is there a bug with WLS 8.1 SP4?

Thanks guys
Hi guys,
It worked when I set "transacted" to false.

Old ---> QueueSession qsession = qconnect.createQueueSession(true,0);
New ---> QueueSession qsession = qconnect.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);

Also I realised that Session.AUTO_ACKNOWLEDGE is 1 and not 0! For that matter I can't find out what the static value '0' is in the javax.jms.Session API. Does '0' mean NO_ACKNOWLEDGEMENT?

According to the WLS doc. when "transacted" the ackowledge value is ignored. But somehow this didn't seem to work. Can anyone explain that for me please?

Whats the effect of setting the "transacted" to false? Does it mean that a rollback is not possible if anything down the line fails?

Thanks guys,
[ January 19, 2005: Message edited by: clement valentine ]
Hello all,
Iam testing a simple application using MDB in Weblogic 8.1 but the onMessage() method never gets triggered when messages arrive on the queue!.
This is the gist of things : A session bean writes to the queue and an MDB should receive the message and do a database insert by calling the create method on a CMP.

These are my descriptors:


<destination-jndi-name>queue/Autoshop</destination-jndi-name> ;


This is a portion of my config.xml for the weblogic server showing the JMS setup.

config.xml (weblogic)

<JMSConnectionFactory JNDIName="jms/Autoshop" Name="AutoshopFactory"
Targets="myserver" XAConnectionFactoryEnabled="true"/>
<JMSServer Name="JMSClemDEV" PagingStore="" Store="Ejb20Store" Targets="myserver">
<JMSTopic CreationTime="1105766985348" JNDIName="topic/Autoshop"
JNDINameReplicated="false" Name="TopicAutoshop"/>
<JMSQueue CreationTime="1105775501794"
ErrorDestination="ErrorQueue" ExpirationPolicy="Redirect"
JNDIName="queue/Autoshop" JNDINameReplicated="false" Name="QueueAutoshop"/>
<JMSQueue CreationTime="1106043185507" JNDIName="queue/ErrorQ"
JNDINameReplicated="false" Name="ErrorQueue"/>
<JMSFileStore Directory="ejb20filestore" Name="Ejb20Store"/>
------------------------------------------------------------------------------- ------------------

The queue that Iam writing to is "queue/Autoshop". The queue uses a persistent filestore and I can see that the file contains the messages. But when I check the console it show "MESSAGE_PENDING" = 0 and "MESSAGES" = 0!
I have some 'println' in onMessage(), but they never get printed!!..The MDB just doesn't listen to the destination!!!

Here is my onMessage() method:

Here is the code from the session bean that writes to the queue:

The QueueConnectionFactory is XA enabled..

Thanks guys,
I would do it outside the application (using sql) if there is not much transformation/business rules in moving from one table to another.
eg insert into A select * from B
Hello all,
Iam running oracle8i 8.1.7 on Redhat v8. The default shell for my ORACLE user account is bash and has to be changed to korn shell. Oracle jdbc access doesn't work anymore from korn shell. I tried running a simple application from the linux box to query the database and it comes up with o3Logon security exception. When i change back to bash everything is fine! Any ideas folks??
Hello all,
Is it possible to use stored procedures in a CMP ejb? The primary keys for our database tables are encoded and timestamp generated using stored procs. It would be very handy if we could somehow use stored procs. instead of the container generated jdbc calls. Are there any resources available on this?
Thanks a lot
Hi guys,
I changed the relationship to bidirectional and called the setDept() accessor method from within the ejbPostCreate() and it worked.
ALternatively changing the relationship to one-to-one (unidirectional) from EMP to DEPT also works. So its just a matter of getting the business relationship right.
Thanks a lot!!
Thanks for the reply. So you are suggesting the relationship to be bidirectional. I will give it a try.
Hello all,
Iam in the process of moving to EJB 2 from EJB 1.1 and I have a question regarding the ejbCreate() method.
Lets say I have 2 database tables DEPT and EMP:
2) EMP (EMPNO primary key, ENAME, ADDRESS, DEPTNO foreign key NOT NULL)
I have a one-to-many unidirectional relationship from DEPT--->EMP. These are my abstract accessor methods in DeptEJB:
1) get/set deptNo
1) get/set dname
2) get/set location
3) getEmployees / setEmployees (takes and returns a collection object)

My question is how do I create an EMP?
I tried the following steps.
1) findByPrimarykey the dept.
2) call create on EmpEJB (returns local interface)
3) call a business method in DeptEJB that calls the getEmployees and then setEmployees.
This works fine if the foreign key is declared NULLABLE!..But in case of NOT NULLS, the ejbCreate in step 2 fails. So how can I insert a EMP?
Thanks guys.. It slipped my mind that findAll() returns proxy to the bean implementation. Works fine now...
Hello all,
I have a BMP ejb with a findAll method returning a collection. I have put in a test code in this EJB which displays the object type in the collection.
---------------------------------------in EJB----------------------------------------------------------------
Collection result; //this is the return value from findAll
Iterator itr = result.iterator();
Vector v;
while (itr.hasNext() ) {
Object o =;
System.out.println("class is =" + o.getClass().getName()); //prints java.util.Vector
v = (Vector) o;
The object type is Vector , so everything is fine in the ejb.
The client to this ejb is a session EJB which contains the following code snippet.
----------------------------------------client session EJB------------------------------------------------
ctx = new InitialContext();
exphome = (ExpenseHome) ctx.lookup("ejb/Expense");
Collection result = exphome.findByAll(........)
Iterator itr = result.iterator();
Vector v;
Object o;
while (itr.hasNext() ) {
o =;
System.out.println("class is =" + o.getClass().getName()); //prints $Proxy87 ???
v = (Vector) o;
I don't have any clue why i get this proxy problem?..Can anyone help me out please..First I thought that there was mismatch of stubs, but the problem exists even after installing the application completely.
This is the complete stacktrace.
java.lang.ClassCastException: $Proxy87
at project.expense.servlet.SearchExpResult.doGet(
at project.expense.servlet.SearchExpResult.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
at weblogic.servlet.jsp.PageContextImpl.forward(
at jsp_servlet.__searchexpform._jspService(
at weblogic.servlet.jsp.JspBase.service(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
at weblogic.kernel.ExecuteThread.execute(
Gotcha!!...I was using a field named 'COMMENT' in the table which seems to be an oracle keyword..Everything works fine after I changed it. Strange though how it allowed me to create one in the first place...Thanks a lot all you folks!!
Hi again,
Tried that one too without any luck. The "SCHEMA".Procedure_name occurs because of using some tool to create the SP logged in as another user with SYSDBA privilege. My doubt is at statement 20 (ORA-06512) of the proc. at the insertion of the 2 dates..Is there some problem with that?
I have even tried using oracle.sql.DATE and OracleCallableStatment with the same result..