Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Vandre Caetano

+ Follow
since Dec 19, 2007
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 Vandre Caetano

I don't really like the eventHandler either (Or the eventBus)
Could you explain a bit more how you are doing you AppController? it seens like a good idea.

10 years ago
Hi there

I an jsf application the user upload photos and I am using primefaces <p:graphicImage> tag to show the photos and <p:fileUpload> to upload then, but when put this code in the production server, it start to get really slow and throws a "too many open files" Error

Do you have any idea what could be possibly wrong?

my code for uploading :

And to read the image:

Of course I found no way to close this fileInputStream so far but I sow its implementation of finalize and it seems the garbage collector should be able to handle it... I guess

Do any of you know who to fix it?

By the way, I'm using glassfish 3.1.2 and the homologation server often behaves differently than the glassfish in my computer.

Thanks in advance
11 years ago

I have to discuss with a few people if the next project should be done in java or python, I know a few things about the project: it's going to be web, it will be small at first but is fairly likely to grow into an average size, it is mostly CRUDE with only one database, in the future it will access one or two web services for data, and only 3 people are going to be developing this project.

I already googled a about java vs python and so far I haven't found a lot of pros for java, also I am studding python a bit so I can have a more elaborated opinion and so far this is what I got:

* You need to type less to make the same program in python
* Java is way easier to refactor your application
* Java performance is better
* Python won't make you spend a lot of time configuring you libraries
* I believe maintenance in python is harder, but I don't know it for sure (Python/Django seems a lot like java servlet..)

I really what to keep programming in java but this "you program in python faster" seems to be the main topic right now... is it true? do anyone here have experience in both language who could share some thoughts?

Thanks in advance
12 years ago

Russell Bateman wrote:No, you aren't dreaming. I too have trouble with the images not showing up whenever I see ClassNotFoundExceptions crop up.

The ClassNotFoundExceptions only happened after I closed eclipse for the first time... but then I had the img error... the img error was corrected waayy before I found out what was causing the ClassNotFoundExceptions...

Actually, about the solution.. I was mistaken, the error is still there.. sort of.. it happens once in a while..
13 years ago
I Just found what happened..

commons-logging, common-digester and a few other common Library were automatically loaded to classpatch when I downloaded JSF myfaces thought eclipse, I deleted then, then copied to tomcat libs and everything worked fine..

Now, about the img error, someday I woke up and it was working.. go figure..
13 years ago
Hi there,

Recently I started a jsf project by myself, I installed eclipse 3.5 --> create new project --> Dynamic web Project, selected tomcat 6.0, jsf 1.2 just like the following picture:

Add jsf capability just like the following picture:

It worked fine, at first but then I faced two problems:

First, after a while, my eclipse start to throw this error when I start tomcat:

SEVERE: Error configuring application listener of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.ClassNotFoundException: org.apache.myfaces.webapp.StartupServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.core.StandardContext.listenerStart(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardHost.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardEngine.start(
at org.apache.catalina.core.StandardService.start(
at org.apache.catalina.core.StandardServer.start(
at org.apache.catalina.startup.Catalina.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(
at org.apache.catalina.startup.Bootstrap.main(
25/05/2010 09:22:34 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)

The only way I found to fix it, is to select a different workspace, start it all over again coping the classes/jsf pages I already did from the last workspace

Second, I haven't been able to make a or <h:graphicImage> tag work at all, well, actually eclipse preview find the image but when I start the server and open the page, it says the image can't be found, I already copied my image everywhere in the project with all kind of / ../ ./ references but nothing so far... I'm likely missing something easy but I can't seen to find what.

thanks in advance for any help

13 years ago

Sunny Rodriguez wrote:

Vandre Caetano wrote:
When you fire a property change event, you need to send a string to identify what property is been changed.

So is it possible to have multiple properties being checked for changes?

Yes, you actually check for all properties change, and in the listener implementation you verify what property was changed and what you want to do with it.

Try to code a little, even if you fell insecure, if after a while you still fell too lost, I'll post a more detailed example.
14 years ago

Maneesh Godbole wrote:

Vandre Caetano wrote:
When I did it the first time I had a nice tutorial about it but apparently I don't have it anymore .

Is this the one?

No... but that is a nice one too.
14 years ago

Sunny Rodriguez wrote:

Vandre Caetano wrote:Ok, here is an exemple:

public class SomeThingBean {
public static final String POJO = "pojo";

private Pojo pojo;
private PropertyChangeSupport changeSupport;


I hope it helps

Thank you! It will take me time to understand all of this. E.G., I had to look up POJO, which I now know is an acronym for "Plain Old Java Object".

I am confused by your final POJO string. Can the string contain anything? I guess I'm wondering what the purpose of the string is in general.

When you fire a property change event, you need to send a string to identify what property is been changed.
Lets say all your tabs are listeners of a different property change, what will happen is: Any time any property changes, all your tabs are going to be warned, it's up to the tabs to know if the changed property is the one that matters to then.
When I did it the first time I had a nice tutorial about it but apparently I don't have it anymore .

14 years ago
Ok, here is an exemple:

Then your tabs are going to have something like this:

I hope it helps
14 years ago
I changed a few things in the code, here is one that works:

I thing you mixed up a few things like:
# p1.add(header);
# p1.add(table);
# p1.add(pane);
you use this only when there is no scrollpane in the table:

I hope it helps
14 years ago
Hi there

The think is: I am trying to make sense of java Swing achitecture.
At first I was daydreaming of a Swing architecture where I would have a Model, with some sort of Data Object and a save method. In my humble head it sounded simple...
So I started reading and found the following article:
which talks about Swing separable model architecture using some interfaces like the Document one, and after reading it and trying things on my omw I am far far more lost than when I first started

Consider the following cenario:

1 JPanel with 4 JTextField and a save button

So.. acording to sun, it would need take 4 Documents (one for each field) and 1 ButtonModel(for the button) with some small among of the logic in each of then and.. hum.. In the end it seens... well... overcomplicated so I decided to try something else which got me right back and the lost status.

How would you do a swing architecture where in the end you would have a Model with some sort of Data Object and a save method?
Would you not use Suns Documente/Other models interface? would you override all JComponets with some personal implementation? Is there any page you advice me to read?

Thanks in Advance

Originally posted by Bear Bibeault:
Artificially breaking lines at 80 because old character cells terminals had 80 columns is a bit of a bunk.

So thats the reason behind the 80 characters!!! I was wandering myself for quite a while now

Originally posted by Bear Bibeault:
[QB]P.S. What, no religious wars about tabs vs. spaces? :roll:

I forgot about those!! I'll bring those up to work as soon as monday
but really, to me, it can go either way (p.s.: spaces too)

By the way, have you ever heard about that more than 1 return thing been agains OOP or anything like it? at all?
16 years ago
In the company I work in we are creating some sort of internal java code convention, and lately there has been some discursion about what is and what is not important, the most discursed topics where:

if a line should have more than 80 characters
if we should use ternary expressions
if a method should have more than 1 return (just a note: someone told me that its wrong to have 2 returns in OOP)

So I was interested in what other people think about those, what are your impressions about the java code convention, and if there are other things you also find important to keep your code more readible

Thanks in advance
16 years ago