manu chaox

Ranch Hand
+ Follow
since Apr 10, 2006
Merit badge: grant badges
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 manu chaox


I am currently searching a design pattern for a listener feature. I have many kind of gwt widgets. To each of them I need to add own listener but calling common function in runtime(adding listener).

I would like to have common interface with function e.g. addListener() and every implementing class should add own listener(clickHandler, valueChangeHandler,...) which call same function.

I don't know how it can be solved nicely. Could you recommend a design pattern for it.

Thanks, mc
what way do you think ? I have seen some topics where are written that the HQL doesn't support nested queries.
Hi all,

First of all I am hibernate's greenhorn. I am solving a problem with displaying last PriceEntry from one to many association in hibernate. So I don't know if hibernate support this feature but I think it should.
I have e.g. House and PriceEntry (one-to-many) . Each house has thousands PriceEntries and I need use only last PriceEntry to be display somewhere. I have seen some solution with a hibernate's Filter but I think it filters data after their complete loading. So i cannot be good solution.
From performace reasons I prefer the way the each Hause load only last PriceEntry.

I have implemented this by adding one-to-one association to the last one PriceEntry to each Hause. But I think there can be some nicer solution via Hibernate without adding next columns into a database.
Could you advice me how it can be done.


Hi guys,

I am looking for a design pattern for a situation where I have to create a Widget(DateBox, Label,...) according to a configuration Strings as a input parameter. In the configuration strings there are information about type of widget, size etc.
Do you know a suitable design pattern for this purpose ?

Thank you for a help.
I would like to use extend AbstractTransactionalDataSourceSpringContextTests or something else to not need delete rows temporary created during integration tests. I afraid I have a problem with transactions of test methods. First I am newbie, I have wroted a test method which checks concrete implementation of generics dao. It is common crud functionality. In the test method :

Note: Before test running there is no row in the database.

If I run the content of the test method in the main method (without asserts) then all works fine, it saves into database.
In the meantime I have solved this problem that I extend AbstractDependencyInjectionSpringContextTests and delete each row via hibernateTemplate. But this solution doesn't make sense. Why do I make something what can do a transaction.

Please, could anyone explain this behavior or where can I make mistake ? I have tried so much version of code that I am desperate from it.
I will very happy for your help.

Before test running or running main I get this exception. It appears that there isn't any relationship with the behavior see above. But as I have written I am newbie.
It throws an exception which it appears it hasn't any influence to test.
11 years ago
i am new in maven and I am using
archetype: org.codehaus.mojo.archtypes ear-jee5
for creating ear. But there is something wrong because it generates only one application.xml and others in target/<project> and target/<project>/META-INF are not generated.

So I make a workaround about it with shell script.
But there must be a better solution direct from maven.
Could you help maven beginner. (I am not set anything about build target in pom.xml yet.)

Thanks lot
11 years ago
Thank for your reply and sorry for my late one.

I would like to use this context access only for testing purposes.

I have in web.xml

And if I use your code from main method:

then I get this exceptions:

Do you have any idea why it is not working for me?
11 years ago

can you tell me how I can set timeout for running Work in WorkManager. For instance if the Work run to long then a timeout hung up this Work.

Is there any workaround to achieve this or some configuration (Weblogic 10.3) ?

My first idea was to create other watch Work bounded to basic Work which would hang up the basic Work if it takes long time. But I am not sure because the weblogic sets its count of running Work. So it can occur a situation in which basic Work will running but watch Work will not be running at the same time so then it cannot watch basic Work.

I will be glad for your help.
11 years ago

I have more JMS topics and I need to enable users to connect/disconnect different topics which they chose at runtime.

What way is the best for this situation ? How can I solve this issue ?

Thanks for help

I have tried to use the ExecutorService pool to run more download threads on weblogic application server 11 for my business application. It works. But I am interested in if it is good idea. I have a bit bad feeling that I should use Work Manager.

Is it good idea to use the ExecutorService or should I use the Work Manager from commonj and why ?

Thank you for any reply
11 years ago
I have a web app which is deployed on server. I can access the applicationContext by way which you can see bellow from a servlet.

Now I would like to access it by this way from other part same project:

My problem is I cannot access the xml file when it isn't in main/resources path. I need to have (and I have it there) this xml in main/webapp/WEB-INF.
I have tried different path to this xml but unsuccessully.

Could you help me ?
11 years ago

Mark Spritzler wrote:OK, so it looks like you have your configuration all set up and correct.

The error you are getting is now specific to JPA/Hibernate and not a Spring issue. There is something wrong with your Mapped class. It looks like you didn't set the @GeneratedValue for the @Id correctly or, the database that you are connecting to does not have the Table in it that you are mapping your class to.


It works ! Thank you.
11 years ago

Mark Spritzler wrote:Why do you define two SessionFactories in your config file. The error that you are receiving is coming from the first one, because you did not put the location of the hbm.xml into the hibernate.cfg.xml.

First choose one bean to define for us, then we can help you get that to work if it doesn't work.


Thank for reply.

I prefer use JPA annotations therefore I think the AnnotationSessionFactoryBean would be better for me. I have a few experiences in hibernate mapping via xml configuration files.
I would like to use declarative transactional annotation as well.

So I have edited applicationContext.xml. (All other files are without changes):


11 years ago

I have some trouble with integrating Spring and Hibernate.
First, I use JPA annotation near an entity to create db schema. My code works fine for hibernate alone. I have no persistance.xml. I hope that it isn't necessary.

Now I am trying integrate spring but I have probably a mistake in applicationContext.xml. I would like to use a solution similar to "13.3.2 Implementing DAOs based on plain Hibernate 3 API" on springframework.
Could anyone help to beginner?

My applicationContext.xml

My hibernate.cfg.xml:

My error log:

I would appreciate any help.
11 years ago

Pawan Kr Gupta wrote:Dear The second code will not compile.
This will give you a compile time error - incompatible types error , required:java.util.List<javax.swing.Document> found :java.util.HashSet

Sorry, my mistake. I have edited it. Thank you for reply.
But the question remains.