Prasanna Kulkarni

Greenhorn
+ Follow
since Jan 07, 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 Prasanna Kulkarni

Hi,

I'm defining a JDBC datasource in my weblogic(10.3.5) domain with JNDI name "weblogic.xyzDataSource". I have defined this data source from admin console.
When I try to look up this data source from code, I do not get it instead get a naming exception saying

javax.naming.NameNotFoundException: While trying to look up /weblogic.xyzDataSource in myclass.; remaining name '/weblogic/xyzDataSource'

Some surprising things are -

1. When WLS boots up, it shows a message that this datasource is successfully tied to assigned JNDI name with message like -
[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1315572938610> <BEA-001174> <Creating Data Source named xyzDataSource, JNDI Name = weblogic.xyzDataSource>

2. When I do JNDI tree lookup from admin console, I can see this data source in weblogic tree

3. I tried to change jndi name to something like "XYZ" only but still same error.

4. When I test datasource from admin console, it is successful.

5. Same code works with 8.1 (Now my application is migrated successfully to 10.3 except this error )

My JDBC data source XML is as follows:(Replacing host/user/sid/pwd with real values)

<jdbc-data-source xmlns="http://xmlns.oracle.com/weblogic/jdbc-data-source" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/jdbc-data-source http://xmlns.oracle.com/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd">
<name>BASPDataSource</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@host:1521:sid</url>
<driver-name>oracle.jdbc.driver.OracleDriver</driver-name>
<properties>
<property>
<name>user</name>
<value>name</value>
</property>
<property>
<name>dll</name>
<value>ocijdbc10</value>
</property>
<property>
<name>server</name>
<value>(description=(address=(host=host)(protocol=tcp)(port=1521))(connect_data=(sid=sid)))</value>
</property>
<property>
<name>protocol</name>
<value>thin</value>
</property>
</properties>
<password-encrypted>pwd</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<initial-capacity>1</initial-capacity>
<max-capacity>15</max-capacity>
<capacity-increment>1</capacity-increment>
<shrink-frequency-seconds>900</shrink-frequency-seconds>
<highest-num-waiters>2147483647</highest-num-waiters>
<connection-creation-retry-frequency-seconds>0</connection-creation-retry-frequency-seconds>
<connection-reserve-timeout-seconds>10</connection-reserve-timeout-seconds>
<test-frequency-seconds>120</test-frequency-seconds>
<test-connections-on-reserve>false</test-connections-on-reserve>
<ignore-in-use-connections-enabled>true</ignore-in-use-connections-enabled>
<inactive-connection-timeout-seconds>0</inactive-connection-timeout-seconds>
<test-table-name>dual</test-table-name>
<login-delay-seconds>0</login-delay-seconds>
<statement-cache-size>10</statement-cache-size>
<statement-cache-type>LRU</statement-cache-type>
<remove-infected-connections>true</remove-infected-connections>
<seconds-to-trust-an-idle-pool-connection>10</seconds-to-trust-an-idle-pool-connection>
<statement-timeout>-1</statement-timeout>
<pinned-to-thread>false</pinned-to-thread>
<wrap-types>true</wrap-types>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>weblogic.xyzDataSource</jndi-name>
<row-prefetch>false</row-prefetch>
<stream-chunk-size>256</stream-chunk-size>
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>

My code to look JNDI name is as follows:



Exception:

javax.naming.NameNotFoundException: While trying to look up /weblogic.xyzDataSource inmyclass.; remaining name '/weblogic/xyzDataSource'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
--------------------------------------------

Please help me, I have searched a lot and tried a lot but it does not work


Thanks !
9 years ago
Hi, this is something funny

double amount = 128.98;
System.out.println(amount*100);

This gives answer - 12897.999999999998 and not 12898.00 !

This only happens after 128.98 [E.g for 128.98, 129.98 etc] - also specifically for 0.98, not even 0.99...

Anybody knows the reason ?
12 years ago
Hi,

My friend had following conversation during interview:

Interviewer: Can garbage collection be forced.
My Friend: No, it can not, its a low priority thread and ...We are never sure when it will run.
Interviewer: Yes gc can be forced, If we write a JVM which runs gc thread on definite intervals then we are sure it'll run for sure, and we can force according to timer.

Now, I dont know what the interviewer meant exactly but I think doing something like that will be like not following Java specification so that VM can not be called as "J"VM on the first place.

Any comments? Am I wrong?
15 years ago
Thank you very much for helping ,
both the reasonings seem very logical.
16 years ago
Sorry If I've been confusing.

The method returns int...but fills up the passed array with the
active Thread objects...my question is....
Why the method is designed in such a way...why doesnt it returns array directly...why do we need 2 pass it?
[ January 24, 2005: Message edited by: Prasanna Kulkarni ]
16 years ago
Hi all,
In Java there are some methods, which return their result in the supplied
parameter (most of the times array)... particulary the methods which return array of any specific kind of Objects.
e.g. static int enumerate(Thread[] array) in Thread class.

Now my question is...why these methods' signatures are like this?
Please, don't get me wrong,
but why not the method is designed in such a way that it will directly return the array...and we dont have to supply it as a parameter?

there are number of such methods in io package also.

Is there any specific reason for this type of method signatures?
16 years ago
Yes off course procedure may be wrong !
But just make sure that, you are not keeping two diff resultset open at a time for a single callable statement, more specifically a resultset opened inside while for a prior resultset.
This may cause this weired behaviour.
16 years ago
Hi All;

Here's some wierd problem I'm facing while handeling multiple resultsets from stored procedure.

I've a stored procedure that returns multiple cursors. And I access them
in my code. After accessing the first resultset when I want to access next
one. As usual I code it like

CallableStatement.getMoreResults();
ResultsetObj=CallableStatement.getResultset();

But I get ResultsetObj as null...and I know that stored produre returns valid data for 2nd cursor...as I have confirmed it by running the procedure in stored procedure builder.
I'm using IBM DB2 7.0

I'll be very glad, If anybody can give me the clarification.
Hi all,
I want to know that whethere I can send SMS from website to the mobile
using the JMS api
If it is not possible, then whats the way that I can code such an application. Are there any other apis I can use
Hi All,
Thankx to Michael Yuan first...but now I'll like to put more generelized question--Is there any way that I can write an application using java for sending SMS from website...but I WANT TO USE THOSE APIS which are either provided free or available for free download on sun's site.
Plz...apologize me if anybody feels the wording very primary and basic as I'm aneophyte in this field
17 years ago
Hi All,
I came to know that one can not use javax.wireless.messaging api for j2se. Is there any way that I can write my appliction in j2se and can send
sms from website to mobile.
Can anybody guide me. Also provide me if u know any resource links
Thanx in advance
17 years ago
Hi All,
Can I use javax.wireless.messaging api in j2se? Are any other apis I need to
import if I want to use it?
I want to write an application for sending sms through web?
17 years ago
Hi All,
I want to write application for sending sms from web
Can I use wma api in j2se for writing it
Please help me.
17 years ago
Can I use WMA provided as optional package in J2me for writing application in j2se
I want to write application for sending sms from web. How can I write this application in j2se using only provided wma api in j2me?
Is there any way?
Plz guide me...thanks in advance
17 years ago
Hi all,
I want to write application for sending sms from web
Can I write it in j2se only
Plz Help ms...thanx in advance.
17 years ago