Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Harish Vembu

Ranch Hand
+ Follow
since Jul 19, 2004
Harish likes ...
Netbeans IDE MySQL Database Java
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 Harish Vembu

Good explantion . Even though its a pretty older post. I would like to add further .

Always from a server architecture point of view its better to have an Apache Server handling all the HTTP requests and route it to Apache Tomcat server to handle dynamic pages like servlets and JSP's. I have worked with such integration on projects.
Both are from Apache Open source community and complement each other well.
For the curious and more inquisitive readers please refer an excellent article -

Thanks & Best Regards

11 years ago

Thanks for the reply. State pattern seems appropriate. In reference to the attached image on the reference link (Wiki)

There is an interface called State and implementing classes StateA and StateB and there is a Context class which is used for swapping between states .

In terms of UML representation I could understand the Dotted Line (Generalization) relationship between states and interface.

How is the empty diamond symbol (relationship) between Context and State can be explained?.

Is it a Has a relationship ? Aggregation or Composition?? or Something else ?

Please clarify. Sometimes I get more curious

Best Regards


Thanks All for the replies.

I was of the belief a Decorator pattern would help in this case as it provides alternative to Subclassing and relies on Composition rather than inheritance for such interchangeable behaviour.

If State pattern is applicable. Can anyone provide a high level class diagram (UML representation) of this example under study?

Or other Design pattern like Template method/Strategy would be useful?

Casting subtype to Supertype like below and subsequent deleting it is not desired.

Pilot pilotObj = new Passenger();

Please provide some code snippets.

Thanks in Advance.


I was posed a question regarding dynamic reuse of class/objects at Runtime

I have a generic Person class which like a parent class. I have Pilot, Passenger and Flight Attendant class which are derived some properties and behavior from Parent.

During runtime usage sometimes Pilot could become a Passenger and vice versa for some segment of travel by implementing/not implementing /overriding/not overriding flyPlane() method.

How to model such a set of Classes(objects) so that we can interchange as desired.

We do not want to use Inheritance and Composition is the preferred way of achieving it. In other words use "Has A" relationship instead of "Is a" relationship.

Please provide full answer with code snippets. " Has a" relationship seems to be sometimes not straightforward to use in some instances as above.

Also mention what type of "Has a " relationship would be used a) Composition or b) Aggregation and why one over other in this case.

Thanks in Advance.

Dear All,

I am facing an issue of SOAP fault when I run the sample code provided below. I am copying the Java code and the Output for your reference below.

Java application:


import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;

* Shows how to add a MIME header, of which SOAPAction is one.
public class AddSoapAction {
private static final String WSDL = "";

private static final String NS = "http://www.webserviceX.NET/";

public static void main(String...arg) {
new AddSoapAction().invoke();

System.out.println("\nAll done.");

public AddSoapAction() { }

private void invoke(){
try {
//Prepare service to call
Service service = createService();
QName portQName = new QName(NS, "StockQuoteSoap");
Dispatch<SOAPMessage> dispatch =
SOAPMessage.class, Service.Mode.MESSAGE);

//Add SOAPAction
/* dispatch.getRequestContext().put(

//Prepare Request
SOAPMessage request = createMessage();

//send request and get response
SOAPMessage response = dispatch.invoke(request);

//Write response to console
System.out.println("\nGot Response:\n");

} catch (Exception ex) {

private SOAPMessage createMessage() throws SOAPException {
//Create a SOAPMessage
MessageFactory messageFactory =
SOAPMessage message = messageFactory.createMessage();

try {
SOAPEnvelope env = message.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();

//Create a SOAPBodyElement
QName bodyName = new QName("http://www.webserviceX.NET/",

SOAPBodyElement bodyEl = body.addBodyElement(bodyName);

//Add our data
QName name = new QName("symbol");
SOAPElement symbol = bodyEl.addChildElement(name);

System.out.println("\nCreated Request:\n");

} catch (Exception e) {

return message;

private Service createService() throws MalformedURLException {
URL wsdl = new URL(WSDL);

//Create the Service name
String svcName = "StockQuote";
QName svcQName = new QName(NS, svcName);

//Get a delegate wrapper
Service service = Service.create(wsdl, svcQName);
System.out.println("Created Service: " + service.getServiceName());

return service;


Output :

Created Service: {http://www.webserviceX.NET/}StockQuote

Created Request:

<SOAP-ENV:Envelope xmlns:SOAP-ENV=""><SOAP-ENV:Header/><SOAP-ENV:Body><GetQuote xmlns="http://www.webserviceX.NET/"><symbol>IBM</symbol></GetQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>

Got Response:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

All done.


Can anyone assist me in letting me know as to why its giving SOAP fault ?. Is so how to construct and send a proper SOAP message. The web service hosted on remote server somehow doesn't like the value for SOAP action property : SOAPACTION_USE_PROPERTY, "1"

Any help would be much appreciated .

11 years ago
Dear All,

I have problem in running the below as a Java Application in NetBeans




INFO: Structured second-level cache entries: disabled
Jan 30, 2011 11:12:07 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
Jan 30, 2011 11:12:07 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Jan 30, 2011 11:12:07 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Jan 30, 2011 11:12:07 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Jan 30, 2011 11:12:07 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
Jan 30, 2011 11:12:08 PM org.hibernate.impl.SessionFactoryImpl ><init>
INFO: building session factory
Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at net.sf.cglib.core.DebuggingClassWriter.<init>(
at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(
at net.sf.cglib.core.AbstractClassGenerator.create(
at net.sf.cglib.core.KeyFactory$Generator.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.core.KeyFactory.create(
at net.sf.cglib.proxy.Enhancer.<clinit>(
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(
at org.hibernate.tuple.entity.EntityMetamodel.<init>(
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(
at org.hibernate.persister.PersisterFactory.createClassPersister(
at org.hibernate.impl.SessionFactoryImpl.<init>(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(
at com.mcnz.model.HibernateCrudRunner.main(
Java Result: 1.


It references GameSummary which is in same package.

Any guidance would be much appreciated.

Thanks & Best Regards

Dear all,

I have a basic question regarding HQL and JPQL.

I might be using EJB 3.x, JPA and Hibernate for next project.

I ran some samples with EJB 3.x JPA with Hibenate as ORM framework.

My question is whether we have to use JPQL or HQL or both in entity classes and hibernate files?. If both are needed why both?

Is that something JPQL can do that HQL cannot do and vice versa. Is one better over other?

Thanks in Advance and Appreciate your inputs.

Best Regards

Hi Ritchie and All,

Sorry to poke my nose here .

For the benefit of users like me and all in general

Probably the above reference was taken from Wikipedia @ [url]

This provides a complete history till the latest.

Thanks & Best Regards


Learning never stops...
11 years ago

Thanks Rob and Ritchie. Your answers are spot on.

It really helped.

I was also thinking on those lines of system 32 which is causing to always use JDK 6 version.

I prefixed the path environment variable with JDK 1.4 path and it worked.

11 years ago

Though the answers to the original post were given, I am not able to get the desired Java version somehow.

I have installed JDK 1..6 and JDK 1.4 on my windows XP machine on different paths

Here is what I have in my environment variables

PATH : C:\Program Files\PHP\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
Program Files\PHP\php.ini;C:\j2sdk1.4.2_19\bin;C:\ant-1.5.2\bin;

I have the highlighted the one for JDK 1.4 bin directory in path.

I have JAVA_HOME user variable set to C:\jdk1.6.0_23 which I am not using in PATH.

When I use Java -version I always get version 6 regardless of me changing the PATH to respective JDK bin directory.

I am wary of setting CLASSPATH variable in PATH as advised on this forum.

Please clarify. Appropriate reply would be much appreciated.

Thanks & Best Regards

11 years ago
Hi All,

Thanks for all the congratulatory emails.

All the best and Good Luck.

[ September 16, 2008: Message edited by: Ulf Dittmer ]
13 years ago
Hi Friends,

At last I passed the Exam with 82 % last Friday because of 3 months of hard preparation, good resources and with God's grace/ Good Luck.

My recommedations for succes in this Exam are as below.

1. Mikolai Study Guide and Notes - Easy to revise

2. Mikolai's Quiz - Final brush up

3. J2EE 1.4 tutorial

4. Basic Specs like WS-I BP 1.0a , J2EE and SOAP,WSDL,UDDI,etc.

Though th Exam is going to be revamped with new specs in early next year . The above resources would be the best bet.

Good Luck and

Three Cheers



[ September 16, 2008: Message edited by: Ulf Dittmer ]
13 years ago
Hi Krishnakumar,

I am interested to know further. I can arrange to pick up the voucher from you. My only constraint is that to check whether the Exam Voucher is valid to appear for the EXAM even in USA.

Can you check with Prometric on it?. We can discuss about it too.

Expecting your reply

13 years ago
Can I use this voucher for any Exam even in US then I am interested. Please let me know ASAP. I inquired about it and as per the information I got Voucher bought in India cannot be used here in US.

13 years ago

If so hold it for me I am ready to buy it. But before I do, I want to get it confirmed by giving the voucher number here at prometric center in USA.

I think this is the best way to get it confirmed for taking exam.

Will contact you to get it.

14 years ago