rouven gorsky

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

Recent posts by rouven gorsky

I'm working on a ejb-jar.xml file using Eclipse. Pressing Ctrl+Space should pop up a list with the available xml tags. Strangely enough this feature doesn't work currently. I have also got a persistence.xml where autocompletion does work!



Anyone has an idea how to fix this?
Hi

I'm deploying an ear with a web-module. The war is built using the following ant skript (part of it):

a)


If I'm deploying it the application works perfectly.

As I would prefer the classes to be included in WEB-INF/classes I altered the ant skript in the following way:

b)


The ear is being builded correctly, all the classes are there. Deploying is ok, too. But I get a runtime error:


2010-06-24 16:42:15,303 FATAL [javax.enterprise.resource.webcontainer.jsf.application] java.lang.RuntimeException: Non matching type for @Inject of setter: public void fr.abc.usim.ejbs.ejb.UserManagerBean.setmailService(fr.abc.usim.ejbs.util.MailService) for type: $Proxy125

Anyone has an idea, why a) and b) yield different run time behaviours?

Thanks for your advice.

At

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html

you can read: "The top-level directory of a WAR is the document root of the application. The document root is where JSP pages, client-side classes and archives, and static web resources are stored. "

What are client-side classes (for)?

gorsky
14 years ago
JSP
Hi all

I'm using JBoss with Eclipse. In the Servers view you can set Servers Properties like Address, Port.. or Timeouts and other parameters. What and where resides the file that this information is being stored into?

How do I start JBoss manually (not from Eclipse), with start and stop timeouts set to 240 and 30 respectively?

Thanks for your help.

gorsky
14 years ago
Good day/night

One question about auto-generating DB-schemas:

I have defined the following two Entities:



and



They run in a JBoss application server jboss-4.2.2.GA. I have set some Hibernate-Properties in order to autgenerate the tables on deployment. It all works fine but something puzzles me: These are the two auto generated create queries for the tables:





Why is there no [b]ON DELETE CASCADE[/b] statement in the child-query?? There should be one as I have declared @OneToMany(cascade=CascadeType.REMOVE, mappedBy="parent") in the parent-entity.
Thank you for your assistance.

Gorsky
Hi,

I am new to the ORM Concept. A basic question:

Given the following two a) and b) legal Entity-declarations:

a)


b)

Can anyone explain me, what's the difference in usage between the two? (I don't really understand what @JoinColumn is for.

Thanks for clarifying.

Dear all

Please study the following combobox in my jsf:

<rich:comboBox id="cities"
valueChangeListener="#{myBean.selectionChanged}"
defaultLabel="#{bundle.defaultEntry}" >

<f:selectItems value="#{myBean.cities}" />
<a4j:support event="onselect" reRender="cities" />

<f:validator validatorId="myValidator" />
<rich:ajaxValidator event="onblur" />
</rich:comboBox>

The validator "myValidator" should do some validating when the onblur event is called. It works, at least when I select an entry from the list
and leave the combobox. However when I click into the combobox, not selecting anything and then leave the combox the onblur event
seems not to be fired: the validator method doesn't run. The same thing happens when I vist and leave the combox with tab-key.
Anyone has an idea why that is an what I could do?
14 years ago
JSF
I have got the following servlet and -mapping in my DD:

<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>com.example.web.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/path/to/myservlet</url-pattern>
</servlet-mapping>

/path/to/myservlet is a virtual/logical path. It's not part of the file structure of my web app.

When calling http://localhost:8080/MyWebApp/path/to
I would like the server to respond with a welcome file instead of getting back a 404 error. How would you accomplish this? Please note, that /path/to/myservlet is not a physical path of my Web-Application.






I have made up a constrained resource in my web-app. When I enter the URL to this resource for the first time, the login window appears and after succesful login the page is being rendered in the browser. Now I enter the same URL a second time and the login window doesn't pop up anymore, which is reasonable. (Authentication happens only once).

But:
How will the container know that the second request is from the same user as the first one? Using Session-tracking I first thought. But after disabling cookies in my firefox browser the behaviour doesn't change!

Anyone have an idea?

I've downloaded the santis Simulator from http://www.santis.ch/training/java/jcp/selftester/.
Unfortunately I could not find out how to start the application. The Download consists of a directory that hasn't got a .jar or .exe File. So can anyone please tell me - a beginner - how to start the application. I've read the posts that have been written about this issue but that won't give me an idea. Thanks for your help.
Of course have I read the topic before and reread it. But it doesn't help. After lots of thinking I am pretty shure that the object - after execution of line 7 - referred by bc.ob[1].ob is eligible for gc when code-line 8 is done. You can proofe me wrong by telling me the reference to his object after line 8.
It is true that there will never ever be an output (generated from the finalize method) because the mentioned object is an Gabc[] of length 0. But this doesn't proof - even in case the gc would always run when envoking System.gc() - that there's no Object at all eligible for gc. It only shows that there's no Gabc object eligible for gc.
Anyone agrees?
I need your help:
The following is from Mr. Devaka's ExamLab SCJP Simulator :
Practice Exam 1, question 42:

How many objects are eligible for the Garbage Collector, after executing the line-9 of this programm. F.Y.I: Array is an object.

1. public class Gabc{
2. Gabc ob[];
3. public Gabc(Gabc... gb){
4. ob=gb;
5. }
6. public static void main(String args[]){
7. Gabc bc=new Gabc(new Gabc(),new Gabc());
8. bc.ob[1].ob=new Gabc[]{new Gabc(),bc.ob[0]};
9. bc.ob[0]=null;
10. System.gc();
11. }
12. public void finalize(){
13. System.out.println("-GCed-");
14. }
15. }

According to ExamLab the answer is: A 0, means at that point no Object is eligible for the gc.
What I think is that after executing line 8, there is one Object eligible for the gc: The Object, that was referred before by
bc.ob[1].ob - an array of length 0. So shouldn't the answer be: B 1?

Thanks for your clarification.

Morteza Manavi-Parast wrote:Did you get back the results by email? I did the same assessment but I never receive a reply from sun! Should I retake it?



I've got an email with the score by sections. It doesn't tell which questions you failed neither does it provide the answers. So yes please retake it. If your score in section 1 is 100% then pleas e-mail me or post the answers.
Gooday

The other day I took the SCJP SE 5 Free Proficiency Assessment on sun's website. (I recommend it). In section 1 (questions 1 - 6) I had one false answer. I can't figure out which question I went wrong. Can anyone please tell me the right answers to the first 6 questions from this test? Thanks many.

rouven