[JBoss Cache] - Understanding JBossCache - Caching an object graph with many associations
by Oliver Weiler
Oliver Weiler [http://community.jboss.org/people/helpermethod] created the discussion
"Understanding JBossCache - Caching an object graph with many associations"
To view the discussion, visit: http://community.jboss.org/message/618113#618113
--------------------------------------------------------------
I'm trying to use JBossCache as a JPA/Hibernate 2nd level cache provider to cache repeatedly called queries. The queries return entities of a specific type, lets call it FooType.
FooType looks like the following:
@Entity(name = FooType)
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public class FooType {
protected BarType barType;
@ManyToOne(targetEntity = BarType.class, cascade = { CascadeType.ALL })
BarType getBarType() {
return barType;
}
}
So, Footype has a many-to-one association. Now, when I call the query, only a very small part seems to be put in the cache. I think the reason is because I didn't mark the association with the @Cache tag. Am I correct?
But the real question is:
BarType also has a handful of associations, and these return objects which also provide associations and so on, building a big graph of associations. Now, do I need to
a) annotate all of those classes and b) also annotate the associations
in order for the whole query to be cached?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/618113#618113]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[Datasource Configuration] - JBoss 6 Oracle XA datasource and no-tx-separate-pools
by beaster
beaster [http://community.jboss.org/people/beaster] created the discussion
"JBoss 6 Oracle XA datasource and no-tx-separate-pools"
To view the discussion, visit: http://community.jboss.org/message/618096#618096
--------------------------------------------------------------
We are trying to run JBoss 6 with an Oracle XA datasource.
We started with jboss-6.0.0.Final\docs\examples\jca\oracle-xa-ds.xml for the datasource configuration.
We have been running into exceptions like the following:
{noformat}
2011-07-26 20:04:04,622 WARN [com.arjuna.ats.jta] (Thread-24 (group:HornetQ-client-global-threads-1898046)) ARJUNA-16061 TransactionImple.enlistResource - XAResource.start returned: XAException.XAER_PROTO for < formatId=131076, gtrid_length=29, bqual_length=28, tx_uid=0:ffff0a158387:126a:4e2f5438:6b5, node_name=1, branch_uid=0:ffff0a158387:126a:4e2f5438:6ba, eis_name=unknown eis name >: oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1120)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:249)
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:213)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:629)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:390)
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:975)
at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:729)
at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:459)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
{noformat}
The code does obtain connections both with and without transactions.
It started to appear that there is/was an issue with the <no-tx-separate-pools/> option in oracle-xa-ds.xml.
I looked up org.jboss.resource.connectionmanager.JBossManagedConnectionPool in the JMX Console and found NoTxSeparatePools = false. So I tried other combinations like <no-tx-separate-pools>true</no-tx-separate-pools> and I cannot get NoTxSeparatePools = true.
I was able to change NoTxSeparatePools = true and apply the change in the JMX Console and then stop and start the MBean. I then could run the code without any of the errors.
Does anyone know how I can configure NoTxSeparatePools = true from my oracle-xa-ds.xml configuration or is this something that is a bug that a fix is needed for?
Thanks, Jeff
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/618096#618096]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[Javassist] - VerifyError on auto generated code
by George Taylor
George Taylor [http://community.jboss.org/people/taggat4023] created the discussion
"VerifyError on auto generated code"
To view the discussion, visit: http://community.jboss.org/message/618059#618059
--------------------------------------------------------------
I have a code generator that wraps a set of pojo's. I have been running it using the tools library successfully compiling the java previously.
In the latest version i have changed to javaassist 3.15.0.GA and now my unit tests are constantly failing to run with a VerifyError
I can get around it by commenting out 1 line of code, but this line of code is important to the flow of the application.
The following code will generate a VerifyError (this is extracted from what i add into the classpool and ctclass structures)
import javax.servlet.http;
import uk.co.taylorconsulting.annoweb.web.exception;
import uk.co.taylorconsulting.annoweb.web.cache;
import uk.co.taylorconsulting.annoweb.web.interfaces;
import uk.co.taylorconsulting.annoweb.web.enums;
import org.apache.log4j;
import java.lang;
import uk.co.taylorconsulting.annoweb.annotation.action;
import uk.co.taylorconsulting.annoweb.annotation.cache;
import uk.co.taylorconsulting.annoweb.annotation.form;
import uk.co.taylorconsulting.annoweb.annotation.form.validation;
import uk.co.taylorconsulting.annoweb.annotation.injection;
import uk.co.taylorconsulting.annoweb.annotation.security;
import uk.co.taylorconsulting.annoweb.annotation.web;
import uk.co.taylorconsulting.annoweb.builder.exception;
import uk.co.taylorconsulting.annoweb.builder.structure;
import uk.co.taylorconsulting.annoweb.builder.structure.form;
import uk.co.taylorconsulting.annoweb.builder.structure.helper;
import uk.co.taylorconsulting.annoweb.builder.structure.security;
import uk.co.taylorconsulting.annoweb.builder.structure.view;
import uk.co.taylorconsulting.annoweb.builder.structure.view.method;
import uk.co.taylorconsulting.annoweb.builder.structure.view.parameter;
import uk.co.taylorconsulting.annoweb.builder.util;
import uk.co.taylorconsulting.annoweb.options;
import uk.co.taylorconsulting.annoweb.web.cache;
import uk.co.taylorconsulting.annoweb.web.controller;
import uk.co.taylorconsulting.annoweb.web.enums;
import uk.co.taylorconsulting.annoweb.web.exception;
import uk.co.taylorconsulting.annoweb.web.interfaces;
public uk.co.taylorconsulting.annoweb.site.siteName.root.base.View extends uk.co.taylorconsulting.annoweb.web.controller.WebHelper implements uk.co.taylorconsulting.annoweb.web.interfaces.ViewProcessor{
private static final Logger LOG = Logger.getLogger(uk.co.taylorconsulting.annoweb.site.siteName.root.base.View.class
public View(){}
public process(HttpServletRequest request, HttpServletResponse response)
{if($1.getParameter("dispatch") != null) {LOG.debug("dispatch=dispatch value=" + $1.getParameter("dispatch"));dispatchDispatch($1,$2);}}
public dispatchDispatch(HttpServletRequest request, HttpServletResponse response)
{String val = $1.getParameter("dispatch");LOG.debug("Dispatching for dispatch value=\"" + val + "\"");if(val.equals("login")) {processDispatchLogin($1,$2);} else if(val.equals("actionWithTestObject")) {processDispatchActionWithTestObject($1,$2);} else if(val.equals("notAuthed")) {processDispatchNotAuthed($1,$2);}}
public processDispatchActionWithTestObject(HttpServletRequest request, HttpServletResponse response)
{LOG.debug("AS:processing processDispatchActionWithTestObject");try {ATestObject var0 = null;try{var0 = $1.getParameter("a");} catch (Exception e){}if (var0==null) {try{var0 = (uk.co.taylorconsulting.annoweb.builder.structure.samples.ATestObject)$1.getAttribute("a");} catch (Exception e){}}uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic action=(uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic)Cache.getClassCache("uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic");action.actionWithTestObject(var0);LOG.warn("No default forwards have been defined");} catch (Exception e) {LOG.warn("An error has occured in the action processDispatchActionWithTestObject Exception: " + e.getClass().getCanonicalName() +"(" + e.getMessage() +")");}}
public processDispatchNotAuthed(HttpServletRequest request, HttpServletResponse response)
{LOG.debug("AS:processing processDispatchNotAuthed");try {uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic action=(uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic)Cache.getClassCache("uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic");action.notAuthorised();LOG.warn("No default forwards have been defined");} catch (Exception e) {LOG.warn("An error has occured in the action processDispatchNotAuthed Exception: " + e.getClass().getCanonicalName() +"(" + e.getMessage() +")");}}
public processDispatchLogin(HttpServletRequest request, HttpServletResponse response)
{LOG.debug("AS:processing processDispatchLogin");try {uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic action=(uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic)Cache.getClassCache("uk.co.taylorconsulting.annoweb.builder.structure.samples.StructureTestBasic");action.login();LOG.warn("No default forwards have been defined");} catch (Exception e) {LOG.warn("An error has occured in the action processDispatchLogin Exception: " + e.getClass().getCanonicalName() +"(" + e.getMessage() +")");}}
}
If i put this into a java file and compile it, it is fine and even the javaassist compiile does not complain about the code.
If i remove the ATestObject from the processDispatchActionWithTestObject method's call to action.actionWithTestObject(var0); and replace it with action.actionWithTestObject(null); then this works successfully and doesn't complain, but then as you could imagine breaks the required data.
Can you tell me what i can do to get around this issue. this is the generated code from a unit test that i can get to fail every time (and get to pass by changing the data as mentioned above)
I have attached 2 files of the full java code generated from the unit test one that works and one that doesn't (another way of getting it to work is to remove other code which i also need)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/618059#618059]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - Deploying jBPM 5.1 on jBoss 6
by Chaitanya Desai
Chaitanya Desai [http://community.jboss.org/people/chaitanya1987] created the discussion
"Deploying jBPM 5.1 on jBoss 6"
To view the discussion, visit: http://community.jboss.org/message/617980#617980
--------------------------------------------------------------
Hi,
I was able to deploy jbpm 5.1 on jboss 5.1 with mysql database after modifying hibernate.cfg.xml, testDS1-ds.xml, persistence.xml and Human Task jars - persistence.xml.
I use the same setup of above files and after making some required changes to build, I am facing deployment errors for drools-guvnor.war.
In build.xml Instead of using the target 'install.guvnor.into.jboss.5' to deploy guvnor into jboss 6 i use
<target name="install.guvnor.into.jboss.other">
<copy file="${install.home}/lib/guvnor-distribution-wars-${drools.guvnor.version}-jboss-as-5.1.war"
tofile="${jboss.server.deploy.dir}/drools-guvnor.war"
overwrite="true" />
</target>
I have commented the execution of:
install.guvnor.into.jboss.5
Initially had tried executing both the task for installing guvnor into jboss 6 but later resorted to the approach mentioned above .
In the jboss deployments viewed from localhost:8080 browser i can see gwt-server-console.war, client console.war to be up but not drools-guvnor.war.
I see the exception :
Deployment "vfs:///C:/jboss-6.0.0.Final/server/default/deploy/drools-guvnor.war" is in error due to the following reason(s):
java.lan Deployment "jboss.web.deployment:war=/gwt-console-server" is in error due to the following reason(s): org.jboss.deployers.spi.Deploym
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107)
[ at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417)
[jboss-bootstrap-impl-base. at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Has anyone faced similar issue? How did you resolve it?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617980#617980]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[jBPM] - Deploying jBPM 5.1 on jBoss 6
by Chaitanya Desai
Chaitanya Desai [http://community.jboss.org/people/chaitanya1987] created the discussion
"Deploying jBPM 5.1 on jBoss 6"
To view the discussion, visit: http://community.jboss.org/message/617979#617979
--------------------------------------------------------------
Hi,
I was able to deploy jbpm 5.1 on jboss 5.1 with mysql database after modifying hibernate.cfg.xml, testDS1-ds.xml, persistence.xml and Human Task jars - persistence.xml.
I use the same setup of above files and after making some required changes to build, I am facing deployment errors for drools-guvnor.war.
In build.xml Instead of using the target 'install.guvnor.into.jboss.5' to deploy guvnor into jboss 6 i use
<target name="install.guvnor.into.jboss.other">
<copy file="${install.home}/lib/guvnor-distribution-wars-${drools.guvnor.version}-jboss-as-5.1.war"
tofile="${jboss.server.deploy.dir}/drools-guvnor.war"
overwrite="true" />
</target>
I have commented the execution of:
install.guvnor.into.jboss.5
Initially had tried executing both the task for installing guvnor into jboss 6 but later resorted to the approach mentioned above .
In the jboss deployments viewed from localhost:8080 browser i can see gwt-server-console.war, client console.war to be up but not drools-guvnor.war.
I see the exception :
Deployment "vfs:///C:/jboss-6.0.0.Final/server/default/deploy/drools-guvnor.war" is in error due to the following reason(s):
java.lan Deployment "jboss.web.deployment:war=/gwt-console-server" is in error due to the following reason(s): org.jboss.deployers.spi.Deploym
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107)
[ at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417)
[jboss-bootstrap-impl-base. at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Has anyone faced similar issue? How did you resolve it?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617979#617979]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months