Win a copy of Spring Boot in Practice this week in the Spring forum!

Sandeep Murthy

Ranch Hand
+ Follow
since Oct 05, 2005
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sandeep Murthy

You can give "Hibernate" a try for starters.
9 years ago
Found a solution for my own problem:

It looks like the struts2 framework still needs the Session to successfully redirect to a different URL from within the Interceptor. (Although I don't know why, or is it a bug or a feature).

So, it seems we cannot invalidate the session from within the Interceptor and then redirect the response.
Instead, from the interceptor, I am forwarding to a JSP, and doing the "session invalidate and response.redirect()" thing from within the JSP.

10 years ago
@Mohan Rao: There is no session-timeout defined in web.xml. Hence it will take the default 30 mins.

If you go through my interceptor code above, I am invalidating the session, as it is my requirement. But the problem is, I am getting the error, instead of the response.sendRedirect() working properly.
If I comment out the session.invalidate() code above, the redirect works perfectly.
10 years ago
I'm having a Struts2 interceptor.

Within the interceptor, I'm invalidating the Session, and then redirecting to an URL, outside the application.
Instead of going to the URL, I'm getting the following Exception in the browser - "Session already invalidated".

From the StackTrace, I can see that the exception is being generated from the FilterDispatcher.java, as it is trying to access the session.
I'm not understanding why the FilterDispatcher is coming into picture after being redirected to an URL outside of the application. (For testing purpose, I am redirected to www.google.com)

please see below the code and full StackTrace. Kindly have a look at it and let me know if I'm doing something wrong.
Many thanks in advance for the help.
Code:



Full Stack Trace:
10 years ago
You should stop getting the "Result already committed" error message if you remove the "return null" statement after the redirect.

Explanation:

When you return null, the default result gets executed.
Since you have already done a response.sendRedirect(), you will get the error message when you try to forward again as per the default result.
10 years ago
Issue resolved...

Hi, all... this is now resolved by installing a fix pack on MQ.

Looks like all's well now...

Cheers,
Sandeep
12 years ago
=== Continued ===

Here are some of the approaches that we tried (which did not solve the issue ofcourse):

1. We ensured there are no too many connections open on the channel at the MQ end.
2. Ensured no firewall is preventing this(the platform guys said it's ensured)
3. We set the KEEP_ALIVE attribute to true on the MQ end.

On the EJB end:

I wrote a stand alone client, which posts messages to the same queue, using the same Queue Connection Factory and Queue Destination from the server.
I ran this client from the same machine on which my WebSphere server resides, and try posting the same message which had failed earlier.
I could successfully post hundreds of messages without being able to simulate the error.

This looks completely wired. Nothing I could find in online blogs or WebSphere docs.

Any help please guys... any suggestions or pointers....

Thanks in advance,
Sandeep
12 years ago
Hi all,

This is very strange...
I have an EJB (Stateless Session) deployed on WebSphere 6.0.
It posts a message to a queue, which is configured on a different machine using WebSphere MQ.

Intermittently my application fails to post the message to the queue. The SystemOut.log shows the following exception:


The funny thing is, this occurs intermittently... Upon getting a failure, if I retry with the same request, it will go through successfully.

I cross checked all the configurations on the Queue Destination and Queue Connection Factory with other queues defined on other servers, all values seem to be alright.
I am unable to find out any cause or solution for this... I'm totally clueless

12 years ago
The order of the elements returned will be similar to the order of the columns in database.
Can we use SQLResultSet for specifying custom order?
Hi,
I have 2 columns in a table, both of which refer to a same column in the parent table. This is causing me mapping exception when I'm designing my JPA entities.

For example, In the substitute_item table both item_id and sub_item_id reffer to the item_id in item table, as follows:

substitute_item
-------------------------------
id                      100
item_id               1 [ --> item :: item_id ]
sub_item_id        2 [ --> item :: item_id ]

id                      101
item_id               1 [ --> item :: item_id ]
sub_item_id        3 [ --> item :: item_id ]

item
-------------------------------
item_id                      1
name                      Hard Disk
desc                      Main Storage device

item_id                      2
name                      DVD
desc                      Substitute Storage device

item_id                      3
name                      USB Drive
desc                      Another Substitute Storage device

In the above example, the data in substitute_item table means that the items 2 and 3 are substitute items for item 1.
I know this is a wrong database design, but this is existing schema and I'm helpless here.

My entities are as below:


Now, I'm getting the following exception:



I'm using Spring with JPA, which internally uses Hibernate.
Can anyone please tell me why this exception is occurring? How to do the mapping when 2 columns of a table refer to a same column of another table? How to map with insert="false" update="false"?

Many thanks,
Sandeep
Hi,
You could check if the zip file is correct. ie, if it actually has the required package/class.
Also, now that you are packaging the zip/jar with your web app, try removing the same from your class path in development environment and see if the class is being picked up from web-inf/lib in the development environment. If not, it'll be easy in development env to put in some debugs and check what's happening.
You can also try putting some other jar in web-inf/lib, just for testing and try instantiating any class from that jar. Just to see if this also gives the same problem.
14 years ago
Ideally in such scenarios, some parameter which is common and unique for the entire flow would be available, or should be made available either by passing around or by making it commonly accessible to the entire flow.
Once this is done, the above parameter has to be logged in all logs generated by the entire flow, thus making it possible to trace a given flow.

For E.g:
A customer-id, request-id, order-number, etc can be used, which is available accross the flow.
Logging frameworks like LOG4J allows for customization of the format of the output logs. The log output can be customized to include this common attribute in a very easily identifiable and readable way.
Like for E.g: the log format can be something like this:
<date> <time> <identifier> <log message>
31-07-2998 12:21:01 12345 adsfa dfaf asdfasfasdfadsfasdf
14 years ago
In WebSphere, you can deploy applications (WAR/EAR) in 2 ways:

1. Using the administrative console (the Admin Console)
2. Using wsadmin scripts

Admin Console:
-------------
If WebSphere is installed properly, you will be able to access the admin console through browser with the help of the following url:
http : // ip-address : port /ibm/console/ (without the spaces)
By default, 9060 is the port used by WAS. You can change it by specifying another port during installation.

Once you access the admin console, deploying an application is easy.
You can go to Applications --> Enterprise Applications --> Install New Application link and follow the steps from there.
If it's a WAR you are installing, you can specify the context root.
You can map the application to available servers, and choose to pre compile JSPs as well.

Once you open the admin console, it's pretty simple and self explanatory.

[ July 31, 2008: Message edited by: Sandeep Narasimhamurthy ]

[ July 31, 2008: Message edited by: Sandeep Narasimhamurthy ]
[ July 31, 2008: Message edited by: Sandeep Narasimhamurthy ]
14 years ago
In you WAR, you can specify the classpath entries in the file:
WAR/META-INF/MANIFEST.MF

The classpath entries are specified under "Class-Path:" in manifest.mf.
For e.g: The manifest file content can be as follows:
Manifest-Version: 1.0
Class-Path: lib/xyz.jar lib/castor-0.9.6-xml.jar lib/log4j-1.
2.8.jar lib/xmlbinding.jar config config/xsd config/xml

The entries have to be space separated.
You can include folders and jars in classpath.

[ July 28, 2008: Message edited by: Sandeep Narasimhamurthy ]
[ July 28, 2008: Message edited by: Sandeep Narasimhamurthy ]