amol deshpande

Ranch Hand
+ Follow
since Sep 05, 2003
Merit badge: grant badges
For More
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 amol deshpande


I'm facing some peculiar problem here. I'm using Axis 2, ADB binding framework and a document literal style of WSDL.

I've the schema like above exposed through a single PortType. It has 2 operations : concat and updateUser.

I want concat to take 2 strings as input and updateUser to take a User object.

Because document style can take only 1 part, I've to think about concat. As I would like concat to take 2 strings and not 1 object having 2 strings, I define it according to wrapped method.
Operation name is same as schema type name. To force axis not to create Concat as a parameter java type, I use unwrap = true in wsdl2java task.

This works fine.

But this creates problem for updateUser method which takes a user, but unwrap=true makes it take updateUser(int,String) form.

I hope I'm being clear enough in this description of problem. Please advice if there is a way to have concat(string ,string) and updateUser(User) in java types that axis creates.

Thanks in advance.
14 years ago

As of now axis supports ADB, xmlbeans and jibx. Currently JaxBRI (ref impl) is under experiment. Axis seems to generate mappings depending upon the kind of binder selected.
Is it true that to develop and work with axis WS, one needs to be aware of the way the selected binder works? Fx, ADB doesn't work with restrictions and complex type extensions.

Which one is generally used on projects? The default is ADB.
14 years ago
Thanks Ivan,

I'll try and see if that works for me.

14 years ago
I've read that Axis web services book suggested by srini. It's a nice, clean, concise and easy to read book. I'll recommend it.

What I like about you Fidel is that you are that damn brutally honest guy with yourself. Such people are never meant to least when only person
they have to compete is themselves.

All the best.
14 years ago

In attempting the Top Down approach, we create WSDL first and then Java code. So here we need to specify the schema we will be using
for operation and messages.

What I'm considering is how do we develop schema which will be used in WSDL? We can hand create a schema according to our need and
run wsdl2java which willl create Java Types for them.

Or we can even create Java first, use a tool to convert to schema, then use that into WSDL type. So this is a mixed kind of strategy for Web services.
(Top down and Bottom Up).

Although approach 1 seems to be good, the second one also is appealing, but I've not come across a tool doing so, which we can integrate in build process. What do think?
I'm still kinda inclined to first approach.

14 years ago

Web services is a topic which has evolved as a result of continued integration problems world has faced. Because it includes
integration, it involves more technologies such as XML. I believe XML is perhaps very important aspect for learning WS.

WS is a complex topic as it involves so many stuff which has already been around. But believe me, it becomes very easy to understand
and as in my case very exciting as well.

Are you comfortable with XML, XSD, Parsers and at least some understanding of RPC/RMI? If no, please go back and try to understand them.
When I say understand, don't just therotically look at it, but also do some good sized programs with it. Other what happens is that it involves
so much of abstraction that we tend to look focus of reasoning behind things.

You are not pessimist I'm sure, but may be you need to stay in basics a little more than you have. Treat it as a journey than a destination.

Hope this helps.
14 years ago
If i remove cascade="all", saving a country wouldn't save state.
Was there any undersupply of information?


I've on scenario of 1 to M.

Country -> State where a country may have many states.

A country stores a set of States. So in Country.hbm.xml I've

<set name="states" cascade="all">
<key column="COUNTRY_CODE" not-null="true"/>
<one-to-many unique="true" class="com.o2m.model.State" />

When I create a country with 2 states in Java code, it fires 1 Country Insert, 2 State inserts and 2 update inserts.

Last 2 update inserts are for maintaining relationship link. It seems inefficient.

So to get over the stuff, I made following changes.

In country.hbm.xml, I said inverse="true" for <set> and for state.hbm.xml I said Many-to-one to country and also introduced a country variable in State.
So effectively I reversed the direction of relationship. Now if I save a country, state doesn't get saved in DB. When i have one to many in country.hbm.xml, why doesn't this work?

Best solution would be if approach 1 can work without having updates. Is there a way to do it?
Madhumitha ,

Do you think people would be able to help you out unless you put what's there in your log for this? Put all relevant entries here from log.

14 years ago

Your application is receiving other than ojdbc5.jar (probably 4) when the app is receiving it and it's probably there in classpath somewhere.
Use startServer.log to findout your classpath entries and remove it from there.
Not that if it's there in application classpath dir, ex, web-inf\lib, system won't show that entry in startServer.log.

14 years ago
I'm having a JSP which is full of tags that it calls. A typical call count would be 70-150. So, the JSP has nothing but (custom) tags inside it.
When I hit it for the first time, jsp gets compiled and .class is created. When WAS goes to load that file it takes around 15 mins to load the stuff.
When response comes back, we get proper page rendered in browser, which scales ok even for 500 users.

Here are some findings.

1) Such performance issue is for first time loading of custom tags jsp. Second request onwards response is in a flash.
2) It takes around 20 mins to load the jsp class files + any other required class files. (.class is already compiled.)
3) Issue pops back again when we restart server. So compilation is out of question. The loading is still the issue.
4) It doesn't do any heavy duty stuff in code, just simple UI formation stuff.

As we know a tag instance would be created in method local scope, so all tags would be recreated and executed on each request. We can change this with tag page pooling to instantiate tag at instance level in generated jsp,
still it's not giving any load time improvements.

In my experience I've noted that if you have equiv. jsp methods or helper methods instade of custom tags, it works much much faster.

Do you think it's possible to optimize this or I better move to simple method based solution?

14 years ago

I'm having issue in hotdeployment on Eclipse + weblogic 9.2.

I've following settings:
1) Java Project
2) Open deployment (Deploy from location of installation rather than copying in weblogic internal space).
3) output folder my_app/web-inf/classes
4) Build auto.

I start application using Weblogic main class. The hotdeployment doesn't work. Am I missing something? When I build a change in Java file, it restarts the application server.

Good thought.

My thought went on these lines....

If we have two keys k1 and k2 such that we want them to be treated same by hashing, then we need
2 conditions for them satisfy our needs....1 ) they should pass equals method test...2) they should have same hashCode() results.

But when I have two keys here k1 and k2 such that at k1.hashCode() is never equal to k2.hashCode(), these are anyway not going to be same in the eyes of why the requirement of equals == false.

Second rule is like first stated with NOT gate applied. So i'll burn this in the brain .... I'm thinking that if k1.hashCode() != k2.hashCode(), there exists no change that k1 and k2 will be treated same by hashing even if k1.equals(k2) = true.
15 years ago
In a HashMap, following are the required things:

1) if k1.equals(k2) == true then k1.hashcode() == k2.hashcode() should be true;

This is because hash code decides the bucket which is to be hit. Equals selects the element within a bucket. So if equals() says true, hash code must be same.

2) if k1.hashCode() != k1.hashCode() then k1.equals(k2) should be false.

If the buckets aren't same, i realise that there cannot be two equal objects. So k1 and k2 equals is false.

Just to increase my clarity over the matter, I'm thinking that if two hashCode() are unequals, their buckets are always different. But why should it be mandatory to have k1.equals(k2) as false? Shouldn't it be optional?

15 years ago