Abdul Rahman

Ranch Hand
+ Follow
since Jul 04, 2008
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 Abdul Rahman


I need to invoke some methods through a webservice call. I've the wsdl url. I need to know step by step procedure on how to invoke a secured https webservice. I have eclipse. I got the stubs generated through eclipse using Axis. I've deployed my application on tomcat 7 server and when I hit the application I get authentication error. I don't understand how to pass the credentials. Can anyone help me in understanding how to pass the user credentials in order to invoke the methods provided by this service. Is there any tool or code for it ?

Any help would be highly appreciated and thanked.

7 years ago

I want to know what are theopen source alternatives to workmanager provided by websphere. Situation is I have multiple tasks to be completed and I want these tasks to run concurrently on different threads. Since creating native thread is not advisable for known reasons, I used the workmanagers provided by websphere. Now I want to know if there are alternatives to using the workmanager concept and whether these alternatives can run standalone or do they need a container and if they need container, will any of these alternatives work on basic server like Tomcat.

I would appreciate any suggestions and help.

7 years ago
Hi I too have the same problem. I'm trying to configure a data source in my weblogic server 8.1. I get this error while testing driver configuration : JDBC driver is not on the CLASSPATH

I put the related jar file in the server's lib folder like: weblogic81\server\lib.
In my domain's startWebLogic.cmd i modified this file to include the above jar file in the classpath something like this: CLASSPATH=%WEBLOGIC_CLASSPATH%;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.jar;%WL_HOME%\server\lib\webservices.jar;%WL_HOME%\server\lib\MYJAR.jar;%CLASSPATH%

I stopped and started the server. Yet I get the above error. Any help in this regard will be highly appreciated. I've spent a couple of hours now trying to figure this out but can't.

10 years ago
Reading book does give you a comprehensive picture of what things are. However, it should not be mistaken that reading alone suffices to code real applications.
We do need to get the concept from the book or online tutorial, think on it, and apply it on some small application and code and test it.

This way learning becomes fun and many things which book or tutorials cannot teach you (because of the scope and nature), becomes clearer. The more exception or errors you get and handle them the more you get to know the intricacies of the concept you just read and implemented.

This is what I do personally. Hope that helps.
11 years ago
Hey thanks buddies...i get it now...static modifier is used for utility methods. Methods that return the same result everytime and doesn't depend on the state of the object.

David Newton wrote
Isn't static stuff covered in the SCJP?

David, your comments really kicked me to go through the book again...

And Muhammad Ali Khojaye, thanks for your important suggestion

Another important point to consider when you make method static is that you must make sure there
is no chance you’ll want it to behave polymorphically.

11 years ago

Appreciate if someone can explain me the scenarios when static modifier should be used with variables and methods.

Why and when should we make a method static and is there any loophole making a variable or a method static.
11 years ago

Can anyone explain me the difference between HttpServletRequest's getUserPrincipal() and getRemoteUser().

As per the api,

getRemoteUser(): Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
getUserPrincipal: Returns a java.security.Principal object containing the name of the current authenticated user.

The Principal class has a method getName() that returns the name of the principal.

I would like to know under what scenarios these two methods of HttpServletRequest should be used and why.

The reason why i ask is because i need to get the userid of the user who has logged into the application. The application i'm developing is not a dummy application. It is to be used by real people in real scenario. so i need to know the feature of these two methods before i use any one of them.

11 years ago

I'm unable to comprehend the method mapRow(ResultSet rs, int rownum) in the RowMapper interface. I tried to go through the API but i'm still not clear on this.

Can anyone please explain what this method does and what's it used for.

11 years ago
Hi Christophe,

Thanks...I totally missed that element. ..Your reply made that element visible to my eyes...
It's working now...Thanks a lot...
11 years ago
Hi Mark,

I've just one config file (hello.xml).

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"; >
<beans default-autowire="no" default-dependency-check="none" default-destroy-method="" default-init-method="" default-lazy-init="false">
<description>Spring hello application</description>
<import resource=""/>

<bean id="helloBean" class="org.spring.abdul.service.HelloService">

<property name="hello">
<ref bean="helloImpl"/>

<property name="bye">
<ref bean="byeBean"/>

<!-- <bean id="nameBean" class="org.spring.abdul.bean.NameBean" /> -->
<bean id="helloImpl" class="org.spring.abdul.impl.HelloImpl"></bean>
<bean id="byeBean" class="org.spring.abdul.impl.ByeImpl"></bean>


11 years ago

I'm trying to run a simple spring application (from developersbook.com) in myeclipse. I'm getting the below error:

May 26, 2009 7:23:49 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@c40c80: display name [org.springframework.context.support.ClassPathXmlApplicationContext@c40c80]; startup date [Tue May 26 19:23:48 IST 2009]; root of context hierarchy
May 26, 2009 7:23:51 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [hello.xml]
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Resource location must not be empty
Offending resource: class path resource [hello.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:162)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:145)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:130)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:468)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:363)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:394)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:76)
at org.spring.abdul.client.TestClient.main(TestClient.java:16)

I've added spring.jar in my library.
The rest files are fine. The files are very basic and nothing much logic in any of the files.
Can anyone tell me what this error mean ? what and where i'm missing ???

Any help in this regard will be highly appreciated.

11 years ago

I have a suggestion. why don't we have a separate dedicated forum for Spring under the Application frameworks ?

Would like the javaranch people to take initiative asap.

11 years ago

String[] cmdarray=new String[]{"cmd.exe","/c","D:\\prog file\\090422.xls"};
// or Runtime.getRuntime().exec("cmd /c start \"\" \"D:\\prog file\\090422.xls\"");

I've one clarifications to seek. "/c" in the argument tells cmd to execute anything that comes after it. Can we have more than 2 commands to execute using the above exec method ? if yes, then how do we do that ?

11 years ago
Yes that's true. The more you practice the better are your chances of scoring good marks in the final exam.
Hi Lee,

I've few observations to share.

The value of the <load-on-startup> determines the order of loading the servlets by the container. The lesser the value the earlier it starts.

-->If the value is one(1), such servlets has the highest priority of loading the servlet by the container.
-->If the value is zero (0), this has got the least priority and this servlet will be the last to be loaded during the container startup .
-->If two or more servlets have the same value, the servlets in my case (tomcat 5), loaded in the reverse order of declaration in the web.xml.
To simplify, Consider that my web.xml declares 3 servlets with load-on-startup value as 4 in the below order:
The order in which the servlets were loaded in my tomcat5 was ServletC, ServletB, ServletA.
-->If the value of the startup is negative, or the web.xml doesnot mention this element, then the container decides when to load this servlet.

The container will however load such servlets whenever a request comes in.

Hope this clarifies your doubts and confusions