Kamal Tripathi

Ranch Hand
+ Follow
since Oct 02, 2008
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 Kamal Tripathi

I have a rookie question on thread synchronization.

// main didn't wait for OB2 to finish ??

Now most of it makes sense however towards the end lines 8-12 create doubt. I ran the class file twice but both of the times nearly same result, main doesn't join to unfinished threads.

What could be the explanation here?

Consider the follow code for Generic. Because of erasure property I defined the methods differently.

However since the compiler erases the generics these classes will not carry this information forward so does this mean if packaged in a jar I will not be able to call these methods. I know that in real world scenario I am still able to call and get good results but how is "type erasure" effective if this information is deleted during compilation yet when it is required at runtime.
12 years ago

Paul Clapham wrote:
As declared, Movie is a class with a type parameter. So if something is declared as a Movie<Bollywood>, that provides a value for the type parameter. However if something is only declared as a Movie, you don't know what the value of the type parameter might be. It could be a Movie<Western> or a Movie<ChickFlick> or anything else, so you can't make any assumption about what the value of the type parameter might be.

Ah yes. That clarifies, thanks. :thumbup: I should keep reminding me of this difference.
12 years ago

Kiley smith wrote:Hi Darryl and Mike,

Darryl's solution works, thank you. Could some help me understand why my version of this does not work:

My line "myComputerOrder.add(new ComputerOrder(1));" is wanting an IComputerOrder object. Can someone explain this to me? I really want to understand this. Thank you.

Darryl's solution modifies ComputerPart as an interface (rather than a concrete object as the problem suggests). Guessing from what you are trying to implement (after inferring from other answers), your problem may be around the point where you declare interface (IComputerOrder) and how ComputerPart is defined as concrete class. My guess is that your ComputerPart concrete class doesn't implement IComputerOrder interface.

Can you post the code for IComputerOrder and ComputerPart. I am just guessing so I may be wrong.
12 years ago

Paul Clapham wrote:You have an E parameter, but you can't call its getE method because that's a method of Movie<E>, not a method of E.

It's also true that you know E extends Movie, because your class declaration says that, but Movie and Movie<E> aren't the same thing. So you don't know that your E parameter is in fact a Movie<E> reference.

So I suggest you change the class declaration thusly:

Note: I haven't tested this so I may have misdiagnosed the problem. There's plenty of scope for that when you're dealing with Generics!


I came across this post and as I started to think I got confused about what is the difference between Movie and Movie<E>. After all in the first version say if I put a real concrete type, say ComedyMovie, it would become like below

so since ComedyMovie extends Movie (this is the part I am not sure, if at all a raw version of Movie class exists or not) the method getE() would be inherited for ComedyMovie as well.

P.S. yes the change you suggested works so I know what you said is true, just I am getting confused visualizing this scenario
12 years ago

So above is my java code

This is the exception(pasting complete console output) I am getting

Has anyone come across this issue and can help?

Earlier while researching a previous issue, ManifestProxy was earlier not able to execute "findResouces" method so with older versions of jar it was giving a different issue. I checked the latest version, not sure how the change in code could have resolved the issue. Seems earlier the error was NoMethodFoundException and now that has been caught and now it is throwing NullPointerException.

Did any of you face this issue and can help? I have all the classes from GLASSFISH_HOME/lib and GLASSFISH_HOME/module in my classpath.
Jersey is one of the frameworks(more specifically, it is called reference implementation) developed on top of JavaSE 1.5 for RESTful web-services. It uses different set of annotations for cleaner coding.

You can use @WebServiceProvider annotation if you are working with Java SE 1.5 directly without jersey RI. However it comes with setting up of entire configuration, properties which you can avoid with Jersey.

Hope this helps. I would suggest to read this relevant chapter from SOA Using Java Webservices from Mark Hansen. It really explains well the concept of JAX-RS and dwells a little into jersey as well with some examples.

Hope it helps.
If you can point to specific examples, that will help resolve the query faster.

However I think it must work with any java version after 1.5.

Raminder Singh wrote:Hi,
I have just seen fee for SCDJWS(CX-310-230) at http://in.sun.com/training/catalog/courses/CX-310-230.xml and it lists around Rs.17,550.00 (ex. VAT) .

Is this correct one? Normally Oracle Exams are in the range of $125 .. now as Sun is under Oracle, do we expect decrease in the Java's certification fees in coming days?


I think you are looking at training package. This training package will give you some classes and/or some practice sessions or an option to take online CD assignments. If you have relevant experience, I don't think there is any need to take these trainings. Infact, without experience too, there is no need, as the real learning comes in setting up environment, make frameworks work with each other. However I too am an aspirant, with very little webserivces experience. So take this advice with usual disclaimers.

Back to the topic of the cost, instead of taking voucher(which means just one attempt to clear certification with one of the endorsing centers) you can directly register with one of the endorsing centers like NIIT, Aptech centers (either in person or online), they will definitely tell you the right price.

Also I checked online at prometric and the price is still 125 USD. So I believe it should still be 4000 INR roughly. You can use the same link to identify which are the centers in your states, most convenient to you.

Last time I had taken SCWCD certification (2 yrs back), they even offered free retake for same cost. So calling up couple of centers might get you the best deal. Hope it helps

thanks for the reply. However probably my question was not clear. I already understood each policy expression element from your notes. However I was confused how using Optional and Ignorable elements affects each expression. So in this example if we consider the following snippet.

How would it impact the overall policy if I rewrite it like this (note I have switched the attributes)

Point being that if each attribute causes the particular policy to be optional/ignorable (which I am taking means implementer may or may not implement it), why two attributes, why not just one.
Quoting from Ivan's notes

The following policy expression requires:
•Optionally MIME-serialization.
• Transport or message-level security. Additionally there is a policy assertion informing clients that the service performs logging of some kind. This policy assertion may be completely ignored, as specified by the wsp:Ignorable attribute.

Don't both mean the same here??
Take a peek at SCDJWS links section.

Unlike SCJP (and head first) there is no single book dedicated for the certification so you may have to refer various sources for the exam.
Consider the following WSDL. I have trimmed it to keep only wsdl:types and other relevant details. I removed the message, operation and other elements to keep it short. Some XSDs are imported but they are present online so you can take a look at them too.

So here are my questions.

1. Is it a valid include since in first include http://soabook.com/example/oms/orders.xsd has targetNamespace="http://www.example.com/oms" and the WSDL's targetNamespace="http://www.example.com/req". Same is the case with second include as well.
2. I checked this WSDL is working fine with wsimport tool so wondering, how is the targetNamespace="http://www.example.com/oms" being referenced here. Is it because of the enclose <xs:schema> element which defined targetNamespace is also importing it?

If so, what is the experience like.

I am planning to give certification in another month or so and will be registering in another 1-2 weeks so any tips in advance would be helpful.
A project has been created for SOA examples which has WSDL hosted so you can refer that as well. Thanks.