Win a copy of Rust Web Development this week in the Other Languages forum!

Rafael Fagundes

Ranch Hand
+ Follow
since Sep 23, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rafael Fagundes

Rob Prime wrote:If you print the file's absolute path and then check manually if that exists, can you find the file?



Hi Rob! Thank´s for your reply.
Well, I did it and the path was correct but..... so what? What could I do, from this point??? I´ve found out that the wesphere path was the problem! It did not recognise the report path in my application. Once that will not be me who will make the deployment, the best solution for me was take the "bytes by the hand" and pass it to jasper API! Like this:


So, I did put all jasper files in my source directory (line 3), "took the jasper files by the hand "(with the getClassLoader().getResourceAsStream("")) and pass it to the jasper API. It worked´s fine!

..............

Hi all.

Well, in my web application (Struts + WebSphere + JasperReport 3.0 + UNIX), it´s necessery to generate a PDF file.
The PDF file it´s not workin because the API it´s not finding the main jasper file. And it does not trhow any exception

Following the lines:

String str = httpReq.getSession().getServletContext().getRealPath("/reports/" + nomeRel + ".jasper"; // Retrieving the main file
File f = new File(str); // testing the file
f.exists() // the return of it its false

But when I execute the same steps above, looking for an img, the result it´s OK!
Why my application it´s able to find the image but does not work with the jasper file?

Thank´s in advance,
Rafael.


Sorry for my bad english.




Hi.

First of all, I read the topic http://faq.javaranch.com/view?IllegalStateException. But still in doubt since my scenario goes like this:

#1. Web application, using RAD and Struts (servlets, filters, actions, and so on....)
#2. A request to generate a PDF, after the Action.execute processing, works like this:


#3. After the execution above, my filter is throwing the exception whit the warning:


WARNING: Cannot set status. Response already committed.
WARNING: Cannot set header. Response already committed.
javax.servlet.ServletException: getOutputStream() has already been called for this response
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:166)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)



What should I do to avoid this cenario?

Regard´s,
Rafael.

12 years ago
Well,

In my strange world the application started to work with the lookup for the UserTransaction object when I started to use the string: "jta/UserTransaction".

Tear´s.

Rafael Fagundes wrote:Hi all.

I am in a JEE maintenance project and getting the error "Root exception is javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".]". Unfortunately this application starts a java thread in a object instantiated by a user´s request . That´s the point where a lookup for the UserTransaction is done and the exception is throwed.

I know that´s a not good pratice ( https://coderanch.com/t/78414/Websphere/JNDI-lookup-thread-other-than ), but this solution "work´s fine" in the client enviroment (so I can´t change/improve this solution ). Therefore, is there any configuration at the WAS AdminConsole for this case? I read in some place that´s possible with websphere.

Best reguards,
Rafael

PS: excuse me for my bad english.

12 years ago
Hi all.

I am in a JEE maintenance project and getting the error "Root exception is javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".]". Unfortunately this application starts a java thread in a object instantiated by a user´s request . That´s the point where a lookup for the UserTransaction is done and the exception is throwed.

I know that´s a not good pratice ( https://coderanch.com/t/78414/Websphere/JNDI-lookup-thread-other-than ), but this solution "work´s fine" in the client enviroment (so I can´t change/improve this solution ). Therefore, is there any configuration at the WAS AdminConsole for this case? I read in some place that´s possible with websphere.

Best reguards,
Rafael

PS: excuse me for my bad english.
12 years ago
Hi all.

In my web page I need to work with 2 dataTables, one inside of another one.
Each line of the outside dataTable (a kind of product) contains a respective inner dataTable that represent's a list of items of the given product. One item is associated with a checkbox (the user can select one or many of any product). Question: how retrive these checkbox values?

Thank's in advance and sorry for my bad english,
Rafael.

[ October 08, 2008: Message edited by: Rafael Fagundes ]
[ October 08, 2008: Message edited by: Rafael Fagundes ]
13 years ago
JSF

Originally posted by Rafael Fagundes:


It�s correct when you say "a process to come up with a project estimate"! Estimate of effort (mens by hour), for example, to have some project concluded in a give schedule.

I do not agree when you say "it�s a complex process"! As any discipline you need to learn some theory to deal with.

For the same pourpose, there is the COCOMO (Constructive Cost Model) methodology.

You can also try to get project estimates through statistical methods. And this is what I call complex way.

PS: sorry for my bad english!



I forgot something: does not mether the methodology you choose! Only the experience will improve your capability to estimate project variables.

Back on FPA question, I guess that the schedule for each resource on the developing team it�s the mether of the methodology on the execution phase.

Originally posted by Ilja Preuss:
I've never used FPA, but from what I've heard, it's a complex process to come up with a project estimate that is roughly equivalent in reliability to a gut feel guess of an expert.



It�s correct when you say "a process to come up with a project estimate"! Estimate of effort (mens by hour), for example, to have some project concluded in a give schedule.

I do not agree when you say "it�s a complex process"! As any discipline you need to learn some theory to deal with.

For the same pourpose, there is the COCOMO (Constructive Cost Model) methodology.

You can also try to get project estimates through statistical methods. And this is what I call complex way.

PS: sorry for my bad english!
Hi.

Well, waht you need is (in "general lines"):

1. Premises: you need to make a binding of your select box (and it item list component to the respective html component in your managed bean).
2. Some component of your web page must generate an ActionEvent.
3. In the ActionEvent you will add the "extra data" in your select box component through your item list component (add new itens on it).

Now I do not remember the names of the components and properties and
these are the reasons for which I gave the general lines to you.

Hope this help!

PS: sorry for my bad english!
14 years ago
JSF
Hi.

Well, waht you need is (in "general lines"):

1. Premises: you need to make a binding of your select box (and it item list component to the respective html component in your managed bean).
2. Some component of your web page must generate an ActionEvent.
3. In the ActionEvent you will add the "extra data" in your select box component through your item list component (add new itens on it).

Now I do not remember the names of the components and properties and
these are the reasons for which I gave the general lines to you.

Holpe this help!
14 years ago
JSF
I don�t knou but probably threr is some problem with this special character.
Try to use some kind of a MASK / KEY WORD where you identify it as '*'.
14 years ago
Ok, I understood that you want a "hand�s on approach", but the quite essential it�s to (whathever you do) make a UML project first - attempting to develop your OO skills, the pillar of JAVA programm language.

Best regards,
Rafael.
14 years ago
Hello all!

I�m trying to configure commons log api on my project. I created the properties file but my web application can�t find this file. I read in some place that this properties file should be in my project classpath. How can I do it?

Thank�s for your attention,
Rafael.

PS: Sorry for my bad english!!!

Originally posted by Mark Spritzler:
This is usually related to your inverse mapping. You need to make sure it is there and on the right side. So you have a relationship between A and B, and it is bi-directional. So you have links form A to B and from B to A, but you didn't map one side as inverse. you have to do this for bi-directional mapping because those two sides mapping, Hibernate does not know that they are mapping the same relationship, hence the need for the inverse mapping.

What is you mapping between the two classes to the two tables?

Mark



Thank�s for your attention Mark. The mapping I�ve done it was right!!!
I�ve found the solution as follows:

Table3VO {

...

public Table4VO getTable4VO() {

if(this.table4VO == null)
this.table4VO = new Table4VO();

return table4VO;
}

public void setTable4VO (Table4VO table4VO) {

if(table4VO!= null && this != table4VO.getTable3VO())
table4VO.setTable3VO(this); // It�s needed to assure the relation
this.table4VO = table4VO; // define int the mapping
}

}
}

Table4VO {

...

public Table3VO getTable3VO() {

if(this.table3VO == null)
this.table3VO = new Table3VO();

return table3VO;
}

public void setTable3VO (Table3VO table3VO) {

if(table3VO!= null && this != table3VO.getTable4VO())
table3VO.setTable4VO(this); // It�s needed to assure the relation
this.table3VO = table3VO; // define int the mapping
}

}
}

I�m sorry if it was a little bit confused my example!!!

Cheers.
Hello all!

I�m getting the following error:

org.hibernate.exception.GenericJDBCException: could not insert: [Table4VO]

And this is the reason:

SEVERE: [Atinav][JDBC SQL Server Driver:Ver C3.0C] Violation of PRIMARY KEY constraint 'PK'. Cannot insert duplicate key in object 'Table4'.

// ---------------------

MY CENARIO IS:

#1. My rellational mapping it�s like:

Table1VO (Major table whith many to one relationship for Table2VO where
cascade="save-update")

Table2VO (Table whith many to one relationship for Table3VO where
cascade="save-update")

Table3VO (Table whith one to one relationship (bi-direcional association)
for Table4VO where cascade="save-update")

Table4VO (Table whith one to one relationship for Table3VO where
cascade="none" and constrained="true"; the primary key
is a FK: PrimaryKey from Table3)

#2. For updating operation, all the objects instances for the rellational mapping above are duly instantiated. For example:

1 Table1VO has 1 Table2VO that has 1 Table3VO with 1 Table4VO (like in database....... that�s mean, a perfect update)

// ----------

WHAT I WANT it�s to include a new Table3VO object that will generate an insert not only on Table3 but in Table4 also (because the rellationship mentioned above).

// ----------

PROBLEM:

For the collection of Table3VO objects in Table2VO (many-to-one) object, the one that already exists on the database should be updated and the new instance should be inserted. THE SAME THING SHOULD HAPPEN FOR THE Table4!!! But the framework it�s trying to do an insert with the object that already exists on Table4 and that�s is throwing the exception off violation off primary key (even with the right instance of the Table4VO in the respective Table3VO obj.).

Does somebody know what is haaping? Or the reasons???

Thank�s for your attention.

PS: sorry for my bad english!!!