Rohit Bhagwat

Ranch Hand
+ Follow
since Dec 19, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rohit Bhagwat

All,

I dont understand why the compiler doesn't give error for the following statement.

List<? extends String> list1 = new ArrayList<String>();

We know that String is a final class and you cannot subclass it. So why doesnt the compiler mark the statement "? extends String" as error?
In my opinion the only reason for not giving error is because it can contain String objects as well which can be valid. Please correct me if I am wrong.

Thank you,
Rohit.
Hello friends,

I have to write a standalone java application which should get the DataSource object from WebSphere 6.1. DataSource object is of type oracle and is successfully configured in WebSphere's JNDI and I was able to TestConnection successfully. The standalone application is outside websphere context and is configured as a batch process which runs at scheduled time. This application should get the datasource object from JNDI and perform database operations.The main reason for doing this is I want to get rid of storing database credentials in properties file. I created a simple java project and added the following classpath libraries

rsahelpers.jar
rsadbutils.jar
ojdbc14.jar
com.ibm.ws.emf_2.1.0.jar
com.ibm.ws.runtime_6.1.0.jar
com.ibm.ws.admin.client_6.1.0.jar


The program in java file is as follows,


Problem: I want to use dataSource.getConnection() instead of dataSource.getConnection("username", "password"); because the later one involves hardcoding of username and password in java file. However when I invoke getConnection() it throws the following exception.



The datasource object configured in websphere has already been supplied username and password otherwise the testconnection would have failed. My question is why cant I use dataSource.getConnection() method instead of dataSource.getConnection("username", "password")?
If I supply the username and password to getConnection method then everything works fine. I can see the print statements on console.

Does anyone know the solution to this problem ?
Waiting for your reply.

Thank you,
Rohit.
13 years ago
Hello friends,

I have to write a standalone java application which should get the DataSource object from WebSphere 6.1. DataSource object is of type oracle and is successfully configured in WebSphere's JNDI and I was able to TestConnection successfully. The standalone application is outside websphere context and is configured as a batch process which runs at scheduled time. This application should get the datasource object from JNDI and perform database operations.The main reason for doing this is I want to get rid of storing database credentials in properties file. I created a simple java project and added the following classpath libraries

rsahelpers.jar
rsadbutils.jar
ojdbc14.jar
com.ibm.ws.emf_2.1.0.jar
com.ibm.ws.runtime_6.1.0.jar
com.ibm.ws.admin.client_6.1.0.jar


The program in java file is as follows,


Problem: I want to use dataSource.getConnection() instead of dataSource.getConnection("username", "password"); because the later one involves hardcoding of username and password in java file. However when I invoke getConnection() it throws the following exception.



But this datasource configured in websphere has already been supplied username and password otherwise the testconnection would have failed. My question is why cant I use dataSource.getConnection() method ?
If I supply the username and password to getConnection method then everything works fine. I can see the print statements on console.

Does anyone know the solution to this problem ?
Waiting for your reply.

Thank you,
Rohit.
Hello friends,

I have to write a standalone java application which should get the DataSource object from WebSphere 6.1. DataSource object is of type oracle and is successfully configured in WebSphere's JNDI and I was able to TestConnection successfully. The standalone application is outside websphere context and is configured as a batch process which runs at scheduled time. This application should get the datasource object from JNDI and perform database operations.The main reason for doing this is I want to get rid of storing database credentials in properties file. I created a simple java project and added the following classpath libraries

rsahelpers.jar
rsadbutils.jar
ojdbc14.jar
com.ibm.ws.emf_2.1.0.jar
com.ibm.ws.runtime_6.1.0.jar
com.ibm.ws.admin.client_6.1.0.jar


The program in java file is as follows,


Problem: I want to use dataSource.getConnection() instead of dataSource.getConnection("username", "password"); because the later one involves hardcoding of username and password in java file. However when I invoke getConnection() it throws the following exception.



But this datasource configured in websphere has already been supplied username and password otherwise the testconnection would have failed. My question is why cant I use dataSource.getConnection() method ?
If I supply the username and password to getConnection method then everything works fine. I can see the print statements on console.

Does anyone know the solution to this problem ?
Waiting for your reply.

Thank you,
Rohit.
Friends,

I get the following exception when I start managed server in weblogic 9.2. I have created a datasource and made sure that test connection is successfull. However when I start the server I get the following exception. Can anyone please help me what might be going wrong ? Following are the logs generated. I have not posted all the contents of the log due to size constraints.
.
.
.
.
&lt;Mar 20, 2009 12:27:44 AM PDT&gt; &lt;Notice&gt; &lt;WebLogicServer&gt; &lt;BEA-000365&gt; &lt;Server state changed to RUNNING&gt;
&lt;Mar 20, 2009 12:27:44 AM PDT&gt; &lt;Notice&gt; &lt;WebLogicServer&gt; &lt;BEA-000360&gt; &lt;Server started in RUNNING mode&gt;
&lt;Mar 20, 2009 12:29:23 AM PDT&gt; &lt;Warning&gt; &lt;netuix&gt; &lt;BEA-423420&gt; &lt;Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=HomePage1.&gt;
&lt;Mar 20, 2009 12:29:47 AM PDT&gt; &lt;Warning&gt; &lt;netuix&gt; &lt;BEA-423420&gt; &lt;Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=ServerConfigGeneralTabPage&handle=com.bea.console.handles.JMXHandle%28%22com.bea%3AName%3DmyTestServer%2CType%3DServer%22%29.&gt;
&lt;Mar 20, 2009 12:30:09 AM PDT&gt; &lt;Warning&gt; &lt;Management&gt; &lt;BEA-141239&gt; &lt;The non-dynamic attribute ServerFailureTrigger on weblogic.management.configuration.OverloadProtectionMBeanImpl@642316b([wl_server]/Servers[myTestServer]/OverloadProtection[myTestServer]) has been changed. This may require redeploying or rebooting configured entities&gt;
&lt;Mar 20, 2009 12:40:39 AM PDT&gt; &lt;Error&gt; &lt;WebLogicServer&gt; &lt;BEA-000337&gt; &lt;[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for &quot;614&quot; seconds working on the request &quot;weblogic.kernel.WorkManagerWrapper$1@836aae&quot;, which is more than the configured time (StuckThreadMaxTime) of &quot;600&quot; seconds. Stack trace:
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
weblogic.utils.io.ChunkedInputStream.read(ChunkedInputStream.java:159)
java.io.InputStream.read(InputStream.java:89)
com.certicom.tls.record.ReadHandler.readFragment(Unknown Source)
com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
com.certicom.tls.record.ReadHandler.read(Unknown Source)
com.certicom.io.InputSSLIOStreamWrapper.read(Unknown Source)
sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
java.io.InputStreamReader.read(InputStreamReader.java:167)
java.io.BufferedReader.fill(BufferedReader.java:136)
java.io.BufferedReader.readLine(BufferedReader.java:299)
java.io.BufferedReader.readLine(BufferedReader.java:362)
weblogic.nodemanager.client.NMServerClient.checkResponse(NMServerClient.java:285)
weblogic.nodemanager.client.NMServerClient.checkResponse(NMServerClient.java:310)
weblogic.nodemanager.client.NMServerClient.start(NMServerClient.java:98)
weblogic.nodemanager.mbean.StartRequest.start(StartRequest.java:74)
weblogic.nodemanager.mbean.StartRequest.execute(StartRequest.java:47)
weblogic.kernel.WorkManagerWrapper$1.run(WorkManagerWrapper.java:63)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
&gt;
&lt;Mar 20, 2009 12:41:39 AM PDT&gt; &lt;Error&gt; &lt;WebLogicServer&gt; &lt;BEA-000337&gt; &lt;[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for &quot;674&quot; seconds working on the request &quot;weblogic.kernel.WorkManagerWrapper$1@836aae&quot;, which is more than the configured time (StuckThreadMaxTime) of &quot;600&quot; seconds. Stack trace:
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
weblogic.utils.io.ChunkedInputStream.read(ChunkedInputStream.java:159)
java.io.InputStream.read(InputStream.java:89)
com.certicom.tls.record.ReadHandler.readFragment(Unknown Source)
com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
com.certicom.tls.record.ReadHandler.read(Unknown Source)
com.certicom.io.InputSSLIOStreamWrapper.read(Unknown Source)
sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
java.io.InputStreamReader.read(InputStreamReader.java:167)
java.io.BufferedReader.fill(BufferedReader.java:136)
java.io.BufferedReader.readLine(BufferedReader.java:299)
java.io.BufferedReader.readLine(BufferedReader.java:362)
weblogic.nodemanager.client.NMServerClient.checkResponse(NMServerClient.java:285)
weblogic.nodemanager.client.NMServerClient.checkResponse(NMServerClient.java:310)
weblogic.nodemanager.client.NMServerClient.start(NMServerClient.java:98)
weblogic.nodemanager.mbean.StartRequest.start(StartRequest.java:74)
weblogic.nodemanager.mbean.StartRequest.execute(StartRequest.java:47)
weblogic.kernel.WorkManagerWrapper$1.run(WorkManagerWrapper.java:63)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

This exception occurs when it starts deploying the application. I dont know why all of a sudden this exception came up. Till date the application was getting deployed successfully !!

Waiting for your replies.

Thanks
Rohit.
15 years ago
Thanks for your reply. The issue got resolved when I set the following parameter in VM arguments
-XXMaxPermSpace=256m

Thanks
Rohit.
16 years ago
Friends,

I am receiving OutOfMemoryError when I start managed server in weblogic9.2. Weblogic9.2 provides two java implementation. Jdk1.5 and JRocket. When "Java_Vendor" property is set to Sun, it uses jdk1.5, else by default it picksup JRocket. When I use JRocket then there is no OutOfMemoryError. When using JDK I had set memory arguments as follows
-Xms768m -Xmx1024m
Still cannot get rid of the problem. While using JRocket I dont need to set any VM arguments and it works !!

Can anyone suggest me how can I get rid of this problem? I want to use jdk and not JRocket.

Waiting for your reply.

Thanks
Rohit.
16 years ago
Hello friends,

I am using Weblogic 9.2 and JSF 1.1. I am trying to deploy an ear file which has 5 war files. These war files uses jsf to display pages. Now since each war file would require jsf libraries in their WEB-INF/lib directory, I would like to keep them at common application level rather than replicating them. In the ear I created APP-INF/lib and placed all the jsf jars in it. However when I try to access the page I get error that the page is unable to find the tld file. When I looked into jsp2.0 specs I came to know that the container would look for the tld only at the following places.
�WEB-INF/lib: tld should be present in META-INF dir in the jar file.
�Under WEB-INF directory or within its sub folders.

Now jsf libraries contain its associated tlds, however they are now placed in APP-INF/lib instead of WEB-INF/lib directory to avoid duplicity of libraries.

Now my understanding is you can put common jar files in APP-INF/lib directory but you cannot put jars which uses tld�s since they wont be parsed.

Is my understanding correct? Please provide me your feedback.

Thanks
Rohit.
16 years ago
Please re-verify your classpath entries. ClassNotFoundException occurs when the container is unable to find the class in the classpath.
16 years ago
Can you provide the exception stack trace? It is difficult to find the solution without knowing the exception.
16 years ago
Hey friends,

I got the answer. For axis 2 you need to make an entry in services.list file. Keep all the *.aar files in services folder under WEB-INF folder of Axis2 and that's all you need to make your services available for axis. You should be able to see your services when you hit the url http://localhost:<port_number>/axis2/services/listServices

Thanks
Rohit.
16 years ago
Friends,

I looked at the javadocs for axis and came to know the following points

Gets the axis configuration object by loading the repository. The order of initialization is according the the following precedence:
If the parameter axis2.repository.path is present, this folder is used as the location to the repository.
Otherwise, if the parameter axis2.repository.url is present, the URL is used as the location to the repository.
Otherwise, when both of the above init parameters are not present, the web applications WEB-INF folder is used as the folder for the repository



When I have deployed the application in weblogic 9.2 the directory structure is as follows




conf folder has axis2.xml and services folder has all the services I had deployed. Now if I mention absolute path in web.xml for axis2.xml.path and absolute path for axis2.repository.path then everything works fine.. I am able to see all the webservices I have deployed when I hit the above url.

Can anyone tell me how can I specify the relative path? If I dont specify any init param tag in web.xml, still it doesnt work.

Can anyone please help me ?

Thanks
Rohit.
16 years ago
Hello all,

I am new to axis 2 and weblogic. I have .aar files which are placed under services directory under WEB-INF folder in axis 2. But I am unable to see the list of services present in the .aar files when I hit http://localhost:7003/Trac/services/listServices

The only service that I can see is version service. When I checked the logs I found the following error



I searched over internet but was unable to find a solution to this problem. I am using weblogic 9.2 and axis 2.

Also I have multiple war files in a single ear. I hope that is not causing the problem.. One of the suggestion I read on website is to pull out axis2.war and make it available at the root and check whether services are getting listed. But that will not solve the purpose since these are bundled in my ear.

Following is an entry from web.xml


Can anyone please help me out of this problem ?

Waiting for your replies..

Thanks
Rohit.
[ December 10, 2008: Message edited by: Rohit Bhagwat ]
16 years ago

Originally posted by Daniel Gee:
I have the WebLogic 8.0.1 installed in my PC. I am testing a very simple web application example and got the error message shown below. How could this kind of error happen? What is the cause of the error? How do I fix the problem?



Hello all,

I also getting the same exception with weblogic 9.2. I can see no errors in the log but when I click the url under Testing tab then it throws the above error in the browser. Can someone suggests what can be wrong ?

Waiting for your reply.

Thanks
Rohit.
16 years ago
Hello friends,

I read the entire thread written above.

As per the specification
1. Stateless session bean should not implement SessionSynchronization interface
2. Statefull session bean with BMT should not implement SessionSynchronization interface.
3. Only Statefull session bean with CMT can implement SessionSynchronization interface.

I know that in case of CMT when the transactional method starts, a transaction is started and when the method ends, the transaction ends.
Example: Client calls a method on CMT statefull session bean with transaction attribute of required. A new transaction is created before executing the method and ends as the methods completes.

My understanding is the above statemenet is valid for both statefull and stateless CMT session beans.

If I am correct then why I am not allowed to implement session synchronization interface for stateless session bean with CMT ?

Thanks
Rohit.