Bharat Bonde

Greenhorn
+ Follow
since Mar 12, 2008
Merit badge: grant badges
For More
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 Bharat Bonde

Hello,

My application sends out email attachments(csv,excel,xml) with currency symbols specific to locale.
We use custom Money class to return formatted money strings. £180 etc....

The issue is,the currency symbol is not getting rendered in csv attachment files(it renders them as ?).It works fine for excel and xml.
Also,when I test it in my local env(Jboss 4.3 EAP) the symbols are rendered fine for csv attachments.But in prep env it does not work for csv.
The default charset used by local env jboss is windows-1252 while the prep env uses US-ASCII since it runs on solaris.

Any ideas??

Thanks

14 years ago
Hi sukesh,

You will find this link very useful:
http://downloads.jboss.com/drools/docs/4.0.4.17825.GA/html/index.html

Its the only manual that I was able to find on www!
You can also download drools examples on jboss site.

Thanks
Bharat
15 years ago
Hello,
I have been using StatefulSession(rule) in my project.
I want to decrease the load times of RuleBase which is significant during first request(25-30 secs).During subsequent requests it drops to 2-3 secs.

Does this mean that the RuleBase is getting cached?
I have not done any configuration to cache the rule base.
How do we cache the RuleBase programmatically?

Thanks in advance.

Bharat
15 years ago
Hello,
I want to use Optimistic Locking for concurrency control(As I am expecting may be 5-10 concurrent users).
I am using JPA which is using Hibernate as its persistence provider...
I want to let only one thread to update my entity while the other waits or may be try again...because I don't want to ignore any thread due to OptimisticLockException...
My question is:
What should be the course of action when I get an OptimisticLockException?
Should I catch the exception and in the catch block refresh the entity and try to acquire lock on it and then update it?If so, what happens if while inside the catch block another thread tries to acquire lock on it for update(will it cause another exception)?


Thanks in Advance.
Hello,
I want to use Optimistic Locking for concurrency control(As I am expecting may be 5-10 concurrent users).
I am using JPA which is using Hibernate as its persistence provider...
I want to let only one thread to update my entity while the other waits or may be try again...because I don't want to ignore any thread due to OptimisticLockException...
My question is:
What should be the course of action when I get an OptimisticLockException?
Should I catch the exception and in the catch block refresh the entity and try to acquire lock on it and then update it?If so, what happens if while inside the catch block another thread tries to acquire lock on it for update(will it cause another exception)?

JPA provides READ and WRITE Lock modes...I have read somewhere that some persistence providers have option WAIT as Lock Mode....


Thanks in Advance.
15 years ago
Object comparison in drools is somewhat different but pretty easy.
If you want to compare attributes of 2 objects here is what you have to do:

Object1{
int firstId;
}
Object2{
int secondId
}
Sample Drools file Syntax for comparing 2 objects :
package xxxxx

import Object1;
import Object2;

rule "Object Attributes Comparison"
when
object1: Object1($firstId : firstId)
object2: Object2(secondId == $firstId)
then
System.out.println("Id's are equal");

end

Once you have loaded objects in working memory,you will get the desired sysout(if you have public getters defined for the attributes!)
15 years ago
Hello,

I am using drools for business level validations.
Is it possible to load two objects in working memory and compare their values?
Lets say i have 2 objects:
Object1{
String name;
}

Object2{
String sname;
}

Can I compare name(Object1) with sname(Object2) in the drl file?

Object1(name)==Object(sname)
I tried to add this line in the drl file but it gives an error "Unexpected token name"

Pls help.

[ April 09, 2008: Message edited by: Bharat Bonde ]
[ April 09, 2008: Message edited by: Bharat Bonde ]
15 years ago
Hi Naresh,

What's the issue with your loadbalancing?
16 years ago
The problem is solved....phew!
I changed the workers host in apache from my ip to 127.0.0.1 and it started working.

The other IP belongs to an entirely different network thats why apache was not able to recognise the ip and the port.
16 years ago
I am getting the following log on jboss:

[AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009

That means jboss is listening on 8009.
Is it the apache server that is causing the problem?
16 years ago
Hello,

I am using apache for loadbalancing on top of jboss AS.
The setup worked fine when I used jboss version 4.0.4.
But when I started using jboss 4.2.1.GA,I have been getting the following errors(from mod-jk.log):

[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_connect.c (451): connect to 172.16.5.65:8009 failed with errno=61
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (172.16.5.65:8009) with (errno=61)
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss1) error connecting to the backend server (errno=61)
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss1) sending request to tomcat failed, recoverable operation attempt=1
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_connect.c (451): connect to 172.16.5.65:8009 failed with errno=61
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (172.16.5.65:8009) with (errno=61)
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss1) error connecting to the backend server (errno=61)
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss1) sending request to tomcat failed, recoverable operation attempt=2
[Wed Mar 26 13:54:09 2008][5056:3664] [error] jk_ajp_common.c (1928): (Jboss1) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_lb_worker.c (1012): service failed, worker Jboss1 is in error state
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_connect.c (451): connect to 152.110.149.196:8009 failed with errno=60
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (152.110.149.196:8009) with (errno=60)
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss2) error connecting to the backend server (errno=60)
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss2) sending request to tomcat failed, recoverable operation attempt=1
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_connect.c (451): connect to 152.110.149.196:8009 failed with errno=60
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (152.110.149.196:8009) with (errno=60)
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss2) error connecting to the backend server (errno=60)
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss2) sending request to tomcat failed, recoverable operation attempt=2
[Wed Mar 26 13:54:51 2008][5056:3664] [error] jk_ajp_common.c (1928): (Jboss2) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_lb_worker.c (1012): service failed, worker Jboss2 is in error state
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_lb_worker.c (1106): All tomcat instances are busy or in error state


It seems that the requests are not mounting on JBoss.
I am using apache version 2.0.59.
Do I need to change my apache server to apachev2.2?
I have updated the required files in JBoss(server.xml,META-INF/jboss-service.xml)


Pls advice.

Thanks in advance.
16 years ago
Hello,

I am using apache for loadbalancing on top of jboss AS.
The setup worked fine when I used jboss version 4.0.4.
But when I started using jboss 4.2.1.GA,I have been getting the following errors(from mod-jk.log):

[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_connect.c (451): connect to 172.16.5.65:8009 failed with errno=61
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (172.16.5.65:8009) with (errno=61)
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss1) error connecting to the backend server (errno=61)
[Wed Mar 26 13:54:08 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss1) sending request to tomcat failed, recoverable operation attempt=1
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_connect.c (451): connect to 172.16.5.65:8009 failed with errno=61
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (172.16.5.65:8009) with (errno=61)
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss1) error connecting to the backend server (errno=61)
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss1) sending request to tomcat failed, recoverable operation attempt=2
[Wed Mar 26 13:54:09 2008][5056:3664] [error] jk_ajp_common.c (1928): (Jboss1) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
[Wed Mar 26 13:54:09 2008][5056:3664] [info] jk_lb_worker.c (1012): service failed, worker Jboss1 is in error state
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_connect.c (451): connect to 152.110.149.196:8009 failed with errno=60
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (152.110.149.196:8009) with (errno=60)
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss2) error connecting to the backend server (errno=60)
[Wed Mar 26 13:54:30 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss2) sending request to tomcat failed, recoverable operation attempt=1
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_connect.c (451): connect to 152.110.149.196:8009 failed with errno=60
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (873): Failed opening socket to (152.110.149.196:8009) with (errno=60)
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (1259): (Jboss2) error connecting to the backend server (errno=60)
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_ajp_common.c (1916): (Jboss2) sending request to tomcat failed, recoverable operation attempt=2
[Wed Mar 26 13:54:51 2008][5056:3664] [error] jk_ajp_common.c (1928): (Jboss2) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_lb_worker.c (1012): service failed, worker Jboss2 is in error state
[Wed Mar 26 13:54:51 2008][5056:3664] [info] jk_lb_worker.c (1106): All tomcat instances are busy or in error state


It seems that the requests are not mounting on JBoss.
I am using apache version 2.0.59.
Do I need to change my apache server to apachev2.2?
I have updated the required files in JBoss(server.xml,META-INF/jboss-service.xml)


Pls advice.

Thanks in advance.
16 years ago