Pradeep Mudaliar

Greenhorn
+ Follow
since Oct 11, 2007
Merit badge: grant badges
For More
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 Pradeep Mudaliar

I get what you are implying. I guess testing the code using JMS as stand alone unit would the only option unless someone proves otherwise.
14 years ago
I wish to know about the right approach for testing JMS in my Spring application using JUnit. The JMS resources are being injected in the config XML file using JNDI. Obviously, this cannot be used by JUnit as the objects are bound with the application server (Websphere). With this config file in place, I am not even able to run my other test cases in the application which have nothing to do with JMS. I get BeanCreationException because of NoClassDefFoundError for com.ibm.webspere.naming.WsnInitialContextFactory.

So, if any one can point me to a tutorial or document which would help me with this, I would be grateful.
14 years ago
In the application that I am working for my client, soap message is passed as input to a web service method which accepts a Java bean as an argument. The mapping from the xml input to Java Bean is being handled by Apache CXF which is internally using JAXB for unmarshalling.

The application requires incorrect input data to get replaced by some default value. For eg, if the web service method accepts PersonBean as argument, the XML input would have elements like name, age etc. Now, if the age field in the input comes in as anything other than a number, the value to set in the bean should be a default one specified for it (this may sound strange, but it is for an EAI project and this is what the client wants)

To achieve this without disturbing the architecture in place, I created my own custom CXF interceptor and placed it before the interceptor which unmarshalls the input data in the interceptor chain. Thus I was able to catch the exception when incorrect data was encountered. But, I was not able to find a way to replace the incorrect data with default values. The Message reference passed to the interceptor seems to provide only read-only access to the input XML. I am sorry that I am not supposed to post the actual code here. The custom interceptor that I have developed looks something like this –



So guys, please suggest me your opinions on this. It would be great if anyone here can suggest a way to modify the data wrapped in the message reference passed to the handleMessage method shown above. It would also be good to know about other ways to resolve my problem.
14 years ago
A glance through the first page of this forum lead me to this thread, which I think you may find useful. Another place on the ranch which has a summary of all the things on SCBCD is here.

I am preparing for the certification and currently using the "EJB 3 in Action" book and would recommend it.

... they also praise Manning book , I am hearing it first time . Any idea ?



I think they must be referring to the "EJB 3 in Action" book as its published by Manning. Find it here.
Vikas is right. Your voucher expires on 5th April.
Surround the block of code which instantiates and uses a File Object with a try-catch block as follows -



As also mentioned by Henry, the other way of taking care of checked exceptions is to throw them from the method instead of handling them. So, you can have the controlMenu throw the Exception as follows -



If you go ahead with this approach, methods which invoke controlMenu() would have to handle or throw the exception.
15 years ago
Since we are discussing this on a Java forum, I would suggest you checkout Google Web Toolkit (GWT) - http://code.google.com/webtoolkit/.

Its a good solution for developing AJAX application. Using it, you can write your code in Java and its compiler would covert it to JavaScript.

So, visit the above url and I am sure you will be able to build your search app thereafter. In case, you are still stuck, continue this thread.
15 years ago
One way to do this is by using JavaScript and AJAX. Assuming that you are just starting, you could search the web for JavaScript libraries. There are plenty of these and you could choose one as per your other requirements.
15 years ago
Hey Chaminda,
Congrats on your score and thanks for the tips. I am just starting off and sure they would help.
15 years ago
Hey Joanne,

Thanks for the response. I was unnecessarily beating around the bush. The solution is quite simple and clear. Thanks again!
15 years ago
Hi all,

I wish to authenticate users to a web application using the data from the OpenDS ldap server. I have written the code to connect to the server and it is working fine.

Now, when the user (whose details are stored in an ldif file available to the ldap server) logs in to the application using a user name and password, I want to query the server to get the user�s password. Then I wish to compare the password used by the user for the current session with the retrieved password so that I can authenticate him/her.

The problem I am facing with this is that though I am getting the password attribute for the user using the following snippet -


, I am not able to authenticate the user because the password is encrypted using a scheme which is unknown to my code. I went through the Java API available to OpenDS at

and was not able to find a way to do this. I used a ldap admin tool to check the type of storage scheme used by the server and it turned out to be SSHA. But, I read somewhere that the storage scheme can be set in a property file (I had a quick look through the installation directory of opends and could not locate it ) and hence I dont wish to make the assumption that the scheme would always be SSHA in my code by using the class from the API.

Please suggest a way out of this problem. If the approach I am using is wrong, please correct me.
15 years ago