Paulo Carvalho

Ranch Hand
+ Follow
since Nov 12, 2008
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 Paulo Carvalho


I just started to know Wordnet. I installed it, and with the JWI library, wrote a little class able to return the synonyms, in English, of a given word.

However, I want more than that. I wish to be able to obtain something like this: the synomims for the word "X" in the language "Y".

I searched information about it. I found a very interesting website which can be part of the answer: OpenMultilingualWordnet

In this website, it is possible to get data files (TAB and LMF files) with the information in several languages (one file per language).

The problem is that I don't know how to use these files? Is there any way to integrate/add these files to wordnet? Is there a Java API able to access and interpret TAB/LMF files like JWI interpret Wordnet files?

Is there any other solution that I am not thinking on to achieve my goal?


Best regards.
9 years ago

I developped a Java application with a given structure: a directory containing a .exe file, other configuration files and other subdirectories.

I would like to build a setup.exe installation file for my application. I already used InstallAnywhere some years ago which was very good.

However I would like to find now a similar program but FREE (if the possibility to install the setup file in both windows and Unix environments, better!).

Any suggestion?

Thanks for the help.

Best regards.
11 years ago

I developed a little web service using eclipse + JAX WS. I use it to validate the structure of a XML document. When I deploy the web service directly under tomcat, it runs fine and I get the expected result.

However, If I run the webservice FROM eclipse AND using the same tomcat instance, it is not able to find a resource file (the XSD file I used to check the XML structure of a file).

The code to get the URL of this XSD is the following one:

When I deploy the war file directly from tomcat, the "sFile" is located into the WAR under the WEB-INF/classes directory.

What can I do to put it working fine under Eclipse/Tomcat?


11 years ago

I wrote a simple JaxWS webservice.

I created the sun-jaxws.xml:

And my web.xml file is:

I have also put all the jar files of JAX WS RI on the lib folders of the web service.

I've build the war and it has the expected structure:


Now, I've put the war file on the webapps tomcat folder. Finally, I started tomcat. No errors happened.

However, when I try to access the application using the URL : http://localhost:8080/Generate/report, I get the following error on the browser:

HTTP Status 404 - /HelloWorld/hello
type Status report
message /Generate/report
description The requested resource (/Generate/report) is not available.

Anyone knows the cause of the problem?

Thank you
11 years ago

I have built a JAXWS web service which returns an Object (ResultReport) as result. This class contains a result string and a SOAPMessage.

My webservices executes a method which builds a SOAPMessage. In the web service I have build a test class to verify if everything is OK.

My test class:

My buildReport method:

The result is the expected. The value of the SOAPMessage is written on the console and it is:

However, when I call the buildReport webservice method from a client class, I get an error:

The error happens in the buildReport method when I try to build my SOAPMessage (final SOAPMessage m = (SOAPMessage) TestExport.process(xml);).

For now, it is a simple SOAPMessage. But I am doing this because I want to add an attachment into the SOAPMessage and return it to the client who called the web service.

Thanks for any help
11 years ago

I have a class with an object which contains a list of Strings. In this class I have a runnable method where I want to access this object to add an element in his list.
However, it seems that in my runnable method, the object is not modified. No error is happening.

What can I do to solve my problem?

11 years ago

I have build a Java (swing) application. With my ant file I have now a directory with the exe file of my application, the jar file of my application classes and some subdirectories with configuration files.

With this kind of structure everything works fine on my pc.

Now, I would like to find a clean and professional solution to distribute/install this application on several pcs without having to go install on each pc one by one. I would like to have something automatic which would install my package in several pcs of my choice.

Do you have any suggestion to do this kind of stuff?

11 years ago

I have a question which could have been put in other section of the forum because it is related with several areas of the Java world.

Imagine that I want to develop a web application on Java. This application will have several interfaces with objects (forms), which will interact with a database, and must be able to show tables with information, provide normal insert/update/delete actions, show charts, etc. I want the interfaces be nice looking and the application must be light and effective.

My question is simple. The answer I don't think its so simple.

Today, we have several Java technologies. Everyone have their pros and cons: JSP, Java RCP, JavaFX, etc.

Which solution would you suggest for building such application? Last time I developped a web application it was 5 years ago. I used JSP but now, I have the feeling that this technology is old and others are/can be better...

11 years ago

Thanks for your answer. After trying and trying, I figure that the object returned was an array of objects.
So depending on the scenario, I test if the returned object is an instance of array or something else and then I execute the proper action.

Best regards.
11 years ago

In my rails application, I am using couchrest_model to connect to a couchDB database.

I have a model like this:

In the controller the function is simple:

And in the view I iterate the @authors to show the results.

I would like to implement pagination but I don't know how. I already implemented pagination before, when I was using a PostgreSQL database and active records (will_paginate), but now, I am stuck with this.

Anyone can help me with a simple example?
11 years ago

In my RoR application, I am using Couchrest_model to access a CouchDB database.

I have a model which represents an scientific Article.
I am going to simplify my model to explain it better. An article can have a title, a year and one or more authors.

In the couchDB database, an article can be represented like this:

(In the case the article only have an author)


In the case my article have only one author, I can access author's information (name and age) like this:

But, how can I access the information of authors if the article have more than 1 author?
12 years ago

I am writing a RoR application that connects to a couchDB database using couchrest_model.

The definition of my model is the following one:

class BdsDataAuthor < CouchRest::Model::Base
property :id, Integer
property :first_name, String
property :last_name, String

I would like to be able to get the list of the model columns, e.g., the result of
BdsDataAuthor.columns would be [id, first_name, last_name]

Is it possible? I saw that active_record provides this kind of method (column_names), but since I am not using active_record...

A solution that I tried is to create a method in the model class (it works but its not the "best" solution...):

def getColumns
columns =
columns << "id"
columns << "first_name"
columns << "last_name"

Any idea/suggestion to solve this problem?

Thank you
12 years ago
Yes, this was the problem...

Thank you very much.

Best regards.
12 years ago

I am writing a RoR application which connects to a noSQL database

In the database, I have an author document. The author has a first_name
and a last_name. It also have inside another document: a book. The book
has a title and a year of publication.


I am trying to define the Author model file so I can access Author's
information as so related book information:

However, when in the HTML file I try to access to the book author's
information, I get errors.

HTML example:

The error I get is:
undefined method `title' for :book:Symbol

It's the first time I am developing a RoR application using a CouchDB
application, so I am pretty sure that the problem comes from the way I
am defining the Author's model file.

Can anyone help me about that?

Thank you
12 years ago

I am developing an application on rails using a couchDB database. I already can connect to the database and view some information.
Now I am trying to create a new object of my model.

My model is named author. My controller is named authors.

The code of my model is the following one:

The code of my controller is the following one:

The code of my new.html.erb file is the following one:

The list method is working fine, it shows what I am expecting to.
However, the "new" html page does not shows anything except the title and the "back" link. No error is generated. Everything is ok except that the form is not generated/displayed/rendered.
Does anyone have an idea about the problem/solution of it?
Thank you
Best regards
12 years ago