[EJB 3.0] - ejb3 pooling and maxSessions
by bfach
Hello,
I am running Jboss4.2.2.GA with 1.4.0.SP3.
I have 2 MDBs running. The first MDB accepts the message from a remote client, determines which queue it needs to go to and sends it to the appropriate queue. The second MDB prepares it and sends it to a third party monitoring software.
The issue i am having is that the second MDB requires much more resources than the first. I am trying to tweek the performance to give the second MDB more resources and speed up processing.
So far i have two properties "maxPoolSize" and "maxSessions"
The performance tuning notes for messaging are a bit thin. I am looking for a rule of thumb on these parameters as well as others I might have not mentioned.
The goal is to increase performance for the second MDB. I have tried a variation of the parameters with varried results.
Any help would be greatly appreciated!
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165355#4165355
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165355
17 years, 9 months
[JBossWS] - Re: avoid lazy-initialization exceptions
by florian79
another "ugly" solution is the following:
instad of
| @XmlIDREF
|
use:
| @XmlJavaTypeAdapter(Entity2StringXMLAdapter.class)
|
and here is the implementation for the Adapter:
| public class Entity2StringXMLAdapter extends XmlAdapter<String,BasicEntity>
| {
|
| @Override
| public String marshal(final BasicEntity entityGot) throws Exception
| {
|
| String strValue = "";
| try
| {
| strValue = entityGot.getName() + "(" + entityGot.getId() + ")";
| }
| catch (LazyInitializationException e)
| {
| Long id = this.getEntityID(entityGot);
| if(id == null)
| id = new Long(-1);
| strValue = "lazy (" + id + ")";
|
| }
| return strValue;
| }
|
| @Override
| public BasicEntity unmarshal(final String arg0) throws Exception
| {
| return null;
| }
|
| private Long getEntityID(final BasicEntity entityGot)
| {
| //dirty, but it works:
| //long duration = System.currentTimeMillis();
| Long entityId = null;
| Class clazz = entityGot.getClass();
| for(Field fieldHandler : clazz.getDeclaredFields())
| {
| if(fieldHandler.getType().isAssignableFrom(javassist.util.proxy.MethodHandler.class) && fieldHandler.getName().equals("handler"))
| {
| try
| {
| fieldHandler.setAccessible(true);
| javassist.util.proxy.MethodHandler methodHandler = (javassist.util.proxy.MethodHandler) fieldHandler.get(entityGot);
|
| Field fieldID = AbstractLazyInitializer.class.getDeclaredField("id");
| fieldID.setAccessible(true);
| entityId = (Long)fieldID.get(methodHandler);
| }
| catch (SecurityException e1)
| {
| e1.printStackTrace();
| }
| catch (IllegalArgumentException e1)
| {
| e1.printStackTrace();
| }
| catch (IllegalAccessException e1)
| {
| e1.printStackTrace();
| }
| catch (NoSuchFieldException e1)
| {
| System.out.println("======= THIS EXCEPTION DEPENDS ON A NEWER HIBERNATE VERSION!!!!!! ========");
| e1.printStackTrace();
| }
| break;
| }
| }
| return entityId;
| }
| }
|
BasicEntity is just Interface that is implemented by all my entities with the following methods:
| public Long getId();
| public void setId(final Long idGot);
| public String getName();
| public void setName(final String strNameGot);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165354#4165354
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165354
17 years, 9 months
[EJB 3.0] - MDB in seperate ejb-jar causes problem during deployment
by vdweij
I'm fairly new to MDB and need some help. My ear has got the following structure
ear
| |-- entities-ejb
| | |-- META-INF
| | | |-- persistence.xml
| |
| |-- other-ejb
| | |-- MyMessageDrivenBean
| |
| |-- war
The MDB caused the deployment to fail over the persistence.xml in the other jar. This is from the startup log:
xx:xx:xx,xxx WARN [ServiceController] Problem starting service persistence.units:ear=my-ear-1.0-SNAPSHOT.ear,unitName=my-ds
| javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:216)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| .... and more
When I put the MDB with the entity beans everything deploys fine and the applications including messaging works perfectly.
I also tried to specify jndi.properties but this didn't seem to help.
There are posts about multiple ejb jars and entities in them sharing a single persistence.xml but I couldn't find one addressing this particular issue.
Any help is greatly appreciated!
Running Java 1.5.0_15
Jboss 4.2.2 GA
(Seam 2.0.2.SP1)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165348#4165348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165348
17 years, 9 months