L. Wei

Ranch Hand
+ Follow
since May 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by L. Wei

Hi,

I am building a POC code-first JAX-WS server application. I defined 3 xsds for all my POJOs, Request1, Request2 and RequestMeta. Both Request1 and Request2 extends RequestMeta.

RequestMeta:


Request1:


Request2:


All 3 xsds are in the same targent NS. I used maven-jaxb2-plugin to build 3 classes, Request1, Request2 and RequestMeta. My pom.xml has the plugin configuration as. All 3 classes generated successfully.


Now I have IHello interface and HelloImpl




I got my wsdl file as below,



Here is my question, I only used Request1 as input parameter in IHello.hello(). However, since both Request1 and Request2 extends RequestMeta, I see Request2 is also in my wsdl file. Is there any way that I can get rid of Request2 from this wsdl because it should not be part of this wsdl.
11 years ago
No, no files in the server/default/lib folder. Did I miss anything? I downloaded the jboss-5.1.0.GA-jdk6.zip file only from its download page. should I download the src file?

I did "find . -name jboss-j2ee.jar -print" at the jboss-5.1.0.GA folder, but not find it either.

Christophe Verré wrote:Do you have the following file : /Users/lwei/Tools/jboss-5.1.0.GA/server/default/lib/jboss-j2ee.jar ?

14 years ago
Thank you Christophe. Here is the common.xml. Please advice.



Christophe Verré wrote:Check my question there, and stop duplicating threads.

14 years ago
I am a newbie to EJB and now reading EJB3 in Action. I am trying to run the example of Chapter1. I am setting up JBoss AS 5.1.0.GA and Ant on Mac OSX. I downloaded sample zip file from the book website, and tried to compile the 1st chapter. However, I kept getting the compilation error "package javax.ejb does not exist" while using ant. I tried to modify the build.xml file under the chapter1 folder, but still couldn't get it compiled. I couldn't find any solution in the sample instruction pdf file. Where is the jar file should I include for package javax.ejb? so frustrated...

Here is the build.xml file.


Here is my env setup


I did setup JBOSS_HOME and added ant in the PATH. What did I miss in the setup? Please help...
Thank you Ninad. I tried to modify the build.xml file, but I still couldn't get it compiled. I keep getting the compilation error


Here is the build.xml file of the chapter1 in EJB3 in Action.


and Here is my env setup.


What should I change to get this HelloWorld example run? Which jar file should I include to have javax.ejb package? Please advice. I appreciate it.
14 years ago
Hi,

I am trying to run the examples of "Action In EJB3". I am using osx snow leopard on my macbook. I installed JBoss AS6.0 and Ant, and tried to compile actionbazaar of chapter1. I got "package javax.ejb does not exist" error. I am using Java 1.6.0_20 from osx 10.6.

I know that I need j2ee.jar but where is it? I didn't even find it in JBoss installation folder. Should I install J2ee sdk? Why couldn't I find this jar in jboss folder? Any one can help?
14 years ago

Christophe Verré wrote:How did you run the application ? The HelloUser will not be injected if you execute it outside the container. Try to use Glassfish's appclient instead (there's an example here).



I deployed the ejb in glassfish (I thought it's in container), but I ran HelloUserClient.java as Java Application in Eclipse. I think it's wrong, but I dont know how to run HelloUserClient in Glassfish instead of Java application.
Hi, I am reading "EJB3 In Action", and trying to run the Hello World example in the first chapter in Eclipse. I've correctly setup Glassfish v3 in Eclipse and I've created a server in the Servers console. I created a project and then copied 3 files of the chapter 1 example from the book website www.manning.com/panda

HelloUser.java


HelloUserBean.java


HelloUserClient.java


I deploy the ejb in Glassfish successfully, but when I running HelloUserClient, I got NullPointerException


I know it's because helloUser reference to null. However, is it supposed to be right for this example? or Did I miss anything else? or I can't just copy and paste the sample code into eclipse and run from there? (the book examples are run in command line). I have no clue. Please help. Thanks
false true.

First == returns false because a is not able to compare with b because they are not the same type. They are two different animals. For example,
String a = "abc";
StringBuilder b = new StringBuilder("abc");
a.equals(b); // will cause compile error, they are two types, not comparable.

Since not comparable, the hashCode() of them are definitely not indentical.

Second == returns true because a.equals(c) returns true. They belong to the same String type. They are comparable. Since a is meaningfully equals to c, their hashCode() must be identical. This's the reason why the second == returns true.
Hi,

I just passed SCWCD with 86% this afternoon. I did it at Bucks County Community College at Newtown Pennsylvania. It took me about 50 mins driving from my home to the college. When I arrived the testing center, it was closed. Luckily I met a teacher at that moment. He told me that the testing center is closed today because the guy who charging it just found a new job and won't come today. He asked me if I could reschedule it. I felt so upset because I've prepared everything and I took yesterday off just because of today's exam. Nobody either from the testing center or Prometrics notified me about this change. This guy is so nice. He called a few people to get permission to open the testing center for me, and called the other guy to come right away. I started doing the exam about 30 mins late to the original startup time, which affected my mood at the very beginning. However, after finishing the first 20 questions, I felt better.

The exam is tougher than I thought. I did the mock exam on Head First Servlet and Jsp, but got only 70%(just passed). However, I got 90% on the mock exam on Javaranch. I also did 2 sun ePractice exams, and got 87% and 80%. When I working on these mock exams, I did very quickly, and none of them exceed 2 hrs for 69 questions. The real exam took me 2 hour and 15 mins to finish it. I have no clues to at least 3 questions, because they are never mentioned on the book or in the mock exams.

I got 60 out of 69 correctly. My weakest part is Customer Tag Library (60%). I got a couple of 100% in other sections. After 2 months preparation using my space time in the evening and weekends, I am happy with this grade. I do appreciate this website and the people who answered my questions in patient. I recommend this HFSJ book although it contains some errors. It's the only book I read, and I read it 3 times. To the people who are still preparing the exam, I will remind you to memorize the primary APIs of Servlet, JSTL syntax, EL syntax, default values of attributes, document descriptor and so on. There are 1/4 questions or even more are asking you to find the right syntax. If you can't memorize them, you will easily mess up the similar answers and then failed the exam totally.

I am planning to move on to SCJD. I've ordered the book SCJ Exam with J2SE 5 (2nd edition) from amazon.com. Is there any other studying guide/material I should read? Please advice... Thanks
14 years ago
Can you do?

The question is from Head First Servlet and JSP final mock exam.

Devaka Cooray wrote:Where is this question from? (please QuoteYourSources).

A Classic tag handler exists in legacy code. The author wrote a handler that evaluates its tag body a hundred times, to be used in testing other tags that produce random content.

Given

What is incorrect about the code?
A. Tag handlers are not thread safe, so the iterationCount can become out of sync if multiple users are reaching the page at the same time.
B. The doAfterBody method is never being called because it is not part of the tag handler lifecycle. The developer should have extended the IterationTagSupport class to include this method in the lifecycle.
C. The doTag method should be doStartTag. As written, the default doStartTag of TagSupport is called which simply returns SKIP_BODY, causing doAfterBody to never be called.
D. When doAfterBody returns EVAL_BODY_AGAIN the doTag method is called again. The doTag method resets iterationCount to 0, resulting in an infinite loop and a java.lang.OutOfMemoryError is thrown.

The Final exam answer in the book gives C, but I selected A and C.
This question is regarding the classic tag support. I know simple tag does not reuse tags, but classic tag dose. I ever wrote a snippet code with or without reset of the counter instance variable. The test confirms me that the classic tag reuse the same instance of the tag and keep the status of the instance variable in the tag.

Then why A is incorrect in the question? Thanks.