pranay hira

Greenhorn
+ Follow
since Jun 26, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by pranay hira

okay guess my collegue misunderstood. I did found this:
JAXBContext contextObj = JAXBContext.newInstance(Student.class);
Student myStudent = new Student();
Marshaller marshallerObj = contextObj.createMarshaller();
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

myStudent.setGender("M");
myStudent.setName("Amar");
myStudent.setAge(20);
marshallerObj .marshal(myStudent, new FileOutputStream("Student.xml"));
Dear All,

When I have a java object say Person and I have an XSD can I generate an output XML file. I heard a collega saying something about SAX and DOM parsers.
But reading through the API I only see the other way around. Going from XML to a Java object.

Can anyone give me a tip?

Thanks in advance
I forgot to replace the extend EJBHome to EJBLocalHome :-).

Dear all,

First of all am working on an existing application. We want to 'localize' the remote EJB 2.x used in the application.

The technology stack is:
1. BEA Weblogic 9.23
2. EJB 2.x
3. Java 1.5
4. Maven 2.0.x to build the application

The list of work is roughly:
1. extend EJBLocalObject (business interface) instead of EJBObject
2 extend the EJBLocalHome (home interface) instead of EJBHome
3. remove RemoteExceptions were necessary in the EJB
4. adjust the ejb-jar.xml
<home> tag to <local-home> tag and <remote> tag to <local> tag
5. adjust the weblogic-ejb-jar.xml
change the <jndi-name> to <local-jndi-name>

When building it builds succesfull whenever deploying I am getting this error:


I don't understand this error. When reverting and deploying all works well.

Do you have any tips indicating what might go wrong?

Thanks in advance
I believe a coupon is valid for one year with the SCJA/SCJP
Thank you guys so much. I am going to read the book of Andrew. Too be honest the SCJD kind of scares me. I think am a bit afraid it will be a giant leap. But on the other hand I read the links to other forum posts, and I saw I am not the only one. So I go for it with the help and advises of Java ranch!

Cheers
thank you all :-). Up to the next one. This is really fun. Learning, working hard and then passing the exam!
16 years ago
Mmh are there any new books upcoming to prepare for the SCWCD 5.0?
Dear All,

I would like to head now for SCJD. Do you guys have some preparation tips and go a head tips? Especially if you are not a very experienced programmer
[ February 06, 2008: Message edited by: pranay hira ]
Dear All, Yesterday I passed this exam with a score of 86%. I used the books -SCJA Sun Certified Java Associate Study Guide for Test CX-310-019, 2nd Edition - Incredible Update to the former ExamScam Book

-SCJA Sun Certified Java Associate Exam Questions Guide by Cameron McKenzie Passing Exam CX-310-019

and as an extra test I bought the scja.de test book of Peter-Ralf.

I find the books of Cameron McKenzie very helpfull and it is fun to read/learn with his way of writing.

Well for now up too the next Sun Certificate :-).
16 years ago
you must be incredibly smart to do it in five days :-).

Congratulations!
17 years ago
Dear all, after two months of preparation using the books:
1. SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) (Certification Press Study Guides) Katherine Sierra, Bert Bates
2. SCJP Exam for J2SE 5: A Concise and Comprehensive Study Guide for The Sun Certified Java Programmer Exam (Paperback) Paul Sanghera

I have done the upgrade exam 1.4 to 5.

Thanks to the authors of the book and the peeps on this forum always ready to explain questions from those studying for there exams.

Pranay
17 years ago
Okay thanks for your explanations. I think I got confused because of the static and non static methods.

A static synch method gets the lock of an instance of the MyClass.class. A non static synch method gets the lock of the instance of the object.

Therefore stats and non stats method can't annoy each other in threads.

Kind Regards,
Pranay
Dear all,

Iam trying to understand the following question of the SCJP 5.0 book of Kathy Sierra and Bert Bates:


The answer to this question is that you can add the following implementation of the run method to make sure (kind of a guarantee) that it will produce the output XXYY or YYXX and no other combination of X and Y:

1. public void run() { synchronized(Letters.class) {write();}}
and
2. public void run() { synchronized(System.out) {write();}}

I understand the second answer but I dont understand the first answer. I thought that obtaining the lock of a class is different from obtaining a lock on an instance. And this program is using two instances of the Letter class.

Can someone please explain me why a synch on the Letters.class is also correct?

Kind regard,
Pranay
Iam getting the same error but than with 'email undefined'.
Does any one has an idea what might be wrong? Everything is working validating on Integer, Double but email is not working:

18 years ago