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

Peter Vennel

Ranch Hand
+ Follow
since Dec 18, 2003
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 Peter Vennel

When I do refManager.getDmvStateList() (using local call p1 to p1), I get all the data from the database loaded into my cache.

When I do refManager.getDmvStateList() (using remote call p1 to p2), I do not get all the data from the database loaded into my cache.

Scenario #1
New rows can be added by either of the servers using the same code
base in the app server.

Scenario #2
Plain sql update through sqlplus.


Please refer to the code snippets below:

DmvState.java



RefManagerSessionBean.java


ejb3-entity-cache-service.xml

[ January 31, 2008: Message edited by: Peter Vennel ]
13 years ago
We have two physical servers in load balancing (P1 & P2).

I am caching my entity using Entity Tree cache.

When I call my session bean locally (server p1) to get list of all the records for that entity, it works fine. I get any new rows added to the database table or any updates to a row data. This also automatically refreshes my local cache (server p1).

Now when I make a remote call to get list of records another server (p2) having the same code base, I do not get the newly added rows or updaets, and nor is mthe cache refreshed on that server (p2).

I am calling the same session bean method both the times. Any ideas why this discrepancies?

p.s. both the server point to the same database.

Thanks,
Peter
13 years ago
I need to update our backup database server when I am writing to our current database server.

So I am using two Entity Managers to handle this and pass the same Entity.

em.persist(dmvActivity);
em.flush();

// write to HotSite DB
emTml.persist(dmvActivity);
emTml.flush();


This worked fine, till I made the entity cacheable. Now I get the following error :


javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: com.cp.mvr.common.ejb.persistence.DmvColor


Further, if an entity is set as cacheable, everytime when you do a findAll does the cache get refreshed from the database?

Thanks,
Peter.
14 years ago
Found the problem. I did not have hibernate annotation jar in the classpath for my web module. I only had it for my EJB module.

Adding it to the web module classpath eliminated the problem.

Thanks,
Peter.
14 years ago
Thanks Jai.

I have added those import statements. I have also added the annotation jar file from hibernate (hibernate-annotations.jar).

Peter.
14 years ago
I am trying to cache my entity in JBoss. We are using Hibernate as the persistence provider.

Now I can build my EJB module without any issues. When I try to build my war module, I get the following error:



DmvAuthenticator is my Entity. If I remove the line below from the Entity, I can build my war file.



The code snippet is as below:

DmvAuthenticator.java


Persistence.xml



Any ideas why I am having this problem?

Thanks,
Peter.
14 years ago
I am trying to store errors in struts using ActionMessages and display them in my jsp page. I get the following error:

ERROR [org.apache.struts.taglib.tiles.InsertTag] - ServletException in '/genericError.jsp': Cannot find bean: "msg" in any scope

My code snippet is as follows:

ActionClass


genericError.jsp



I checked some of the earlier postings and did not see anything that would help in my case.

Any help is appreciated.

Thanks,
Peter
[ October 19, 2007: Message edited by: Peter Vennel ]
14 years ago
Problem resolved.

It was a very silly mistake. I had the ANT build script create'meta-inf' instead of 'META-INF'. Somehow when I unjarred and jarred them back manually, the folder was correctly changed to 'META-INF'.

Now after I modified my build script, it got deployed fine.

Thanks for all the help.

Peter.
14 years ago
Problem resolved.

It was a very silly mistake. I had the ANT build script create'meta-inf' instead of 'META-INF'. Somehow when I unjarred and jarred them back manually, the folder was correctly changed to 'META-INF'.

Now after I modified my build script, it got deployed fine.

Thanks for all the help.

Peter.
14 years ago
Thanks Mark.

I am pasting the content of my persistence.xml file and the tree structure of my original jar created by ANT. I did a file compare using textpad. They turned out to be identical and have same size of 455 bytes.

Persistence.xml



Structure of Jar file

14 years ago
I am using ANT build script to create the jar file. When I tried to deploy this to JBoss server, I got errors.

I then tried to unjar the file into another folder and then jar it back using 'jar' command. When I deployed this to JBoss server, this time it got deployed.

This is hapenning on a continuous basis. I am able to replicate this all the time. I am not able to find out what is causing this.

The error is as follows:




Any ideas??

Thanks,
Peter
[ May 31, 2007: Message edited by: Mark Spritzler ]
14 years ago
Thanks Tim.

I was not sure if this is a JBoss issue. But I will post this to JBoss forum to see if anyone had experienced this behavior.

"pre-requisite resource actually didn't load at all"
I totally agree with you on this. What I fail to understand is that why does it work when I unjar the same jar file and then jar them back running 'Jar' from dos prompt.

Peter.
14 years ago
I am using ANT build script to create the jar file. When I tried to deploy this to JBoss server, I got errors.

I then tried to unjar the file into another folder and then jar it back using 'jar' command. When I deployed this to JBoss server, this time it got deployed.

This is hapenning on a continuous basis. I am able to replicate this all the time. I am not able to find out what is causing this.

The error is as follows:



Any ideas??

Thanks,
Peter
14 years ago
Found the problem!



In the above, the variable <authorizedPlans> was defined by me as ArrayList in the form. While debugging, I found out that it should be of type String[].

I feel the error logging of struts is not that good. I had not clue that this was the variable causing the problem.

Anyway, the problem has been resolved.

Thanks to all for your help.

Peter

[ February 16, 2005: Message edited by: Peter Vennel ]
[ February 16, 2005: Message edited by: Peter Vennel ]
16 years ago
Thanks Marc.

My ActionForm does not have any getPlanList() with parameters. It only has getPlanList() with no parameters.

Peter.
16 years ago