[JBoss Web Services Development] - WebServiceContext
by Steve Jagels
Steve Jagels [http://community.jboss.org/people/sej] created the discussion
"WebServiceContext"
To view the discussion, visit: http://community.jboss.org/message/566143#566143
--------------------------------------------------------------
I'm trying to have a web service store info to a session that is unique for each consumer.
@Resource
private WebServiceContext wsContext;
@WebMethod
@WebResult(name="MyMethodResponse")
public Integer MyMethod(){
MessageContext mc = wsContext.getMessageContext();
HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
Integer count = (Integer) session.getAttribute("count");
if(null == count){
count = 0;
System.out.println("new session id=" + session.getId());
}
count++;
session.setAttribute("count", count);
return count;
}
The count is supposed to be incremented each time I go through this method, but it does not.
Is there something I need to add to the consumer code for this? Any other ideas?
I'm using Eclipse 3.4.2, jboss 4.2.3.GA, jdk 1.5.0_17.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566143#566143]
Start a new discussion in JBoss Web Services Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
[jBPM Development] - Deadlock executing TaskService.completeTask()
by Narciso Mazivila
Narciso Mazivila [http://community.jboss.org/people/narzef] created the discussion
"Deadlock executing TaskService.completeTask()"
To view the discussion, visit: http://community.jboss.org/message/566102#566102
--------------------------------------------------------------
Hi,
I am being victm of deadlocks when TaskService.completeTask() is executed.
I use jBPM 4.3 with MS SQL SERVER 2005.
Here goes the stack trace:
|| *
* ||
| org.hibernate.exception.LockAcquisitionException: could not delete: [org.jbpm.pvm.internal.task.SwimlaneImpl#1647413]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:82)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2541)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:56)
at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)
at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
at com.csw.impression.bpm.ExecutionServiceImpl.completeTaskWork(ExecutionServiceImpl.java:192)
at com.csw.impression.bpm.ExecutionServiceImpl.completeTask(ExecutionServiceImpl.java:306)
at sun.reflect.GeneratedMethodAccessor520.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:83)
at org.jboss.ejb3.security.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
at $Proxy252.completeTask(Unknown Source)
at com.csw.impression.rendering.component.panel.AbstractPanel.executeOutcome(AbstractPanel.java:686)
at com.csw.impression.rendering.component.action.OutcomeAction.execute(OutcomeAction.java:141)
at com.csw.impression.rendering.component.action.event.ExecuteActionEventListener.onEvent(ExecuteActionEventListener.java:49)
at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:196)
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:140)
at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1445)
at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1229)
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1009)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:549)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:441)
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Transaction (Process ID 67) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:506)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2523)
... 87 more |
You can find also the deadlock xdl file attached (open with SQL Server Management Studio).
Any help please?
Thanks!!!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566102#566102]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
[JBoss Tools Development] - How to Build JBoss Tools with Maven3
by Max Andersen
Max Andersen [http://community.jboss.org/people/max.andersen%40jboss.com] modified the document:
"How to Build JBoss Tools with Maven3"
To view the document, visit: http://community.jboss.org/docs/DOC-15513
--------------------------------------------------------------
Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.
+*If you're trying to compile JBoss Tools within Eclipse for plugin development, https://community.jboss.org/wiki/JBossToolsTargetPlatformProvisioningorho... read this to get all the dependencies installed.*+
h2. Prerequisites
1. Java 1.6 SDK
2. Maven 3.beta1
3. About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools)
4. subversion client 1.6.X (should work with lower version as well)
h2. Environment Setup
h3. Maven and Java
Make sure your maven 3 is available by default and Java 1.6 is used.
mvn -version
should print out something like
Apache Maven 3.0-beta-2 (r983206; 2010-08-07 07:00:51-0400)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32.14-127.fc12.i686" arch: "i386" Family: "unix"
h3. Sources
Checkout sources from anonymous SVN like
svn co http://anonsvn.jboss.org/repos/jbosstools/trunk jbosstools-trunk
This will take some time dependent on your bandwidth
h2. Build Strategies
Instructions below assume that commands are executed in jbosstools-src folder, in which all sources were previously checked out, as noted above.
There are several strategies to chose from: building everything, building individual component, building a set of components, building individual plugins or features. Depending on where you run Maven, you will aggregate/cascade down into more or less child builds.
But before you can do anything more complicated, you must first build the Target Platform and Parent Pom using this step:
mvn clean install -f build/parent/pom.xml
h3. Build/Test Everything
First, build the Target Platform and Parent Pom as noted above. Then, from the root of the checked out projects (eg., ~/jbosstools-src folder), you can build everything in one step, including running all tests, like this:
mvn clean install
Or, if you want to just compile the modules (plugins, features, tests, update sites) without *running* tests, add the system property *-Dmaven.test.skip=true*.
mvn clean install -Dmaven.test.skip=true
h3.
h3. Build/Test A Particular Component and its Dependencies
For convenience there are bootstrap profiles projects defined for each component. This provides a simple way to build & test components along with all their dependencies.
mvn clean install -f build/pom.xml -P${component.name}-bootstrap
where ${component.name} is component you want to build/test. Check in build/pom.xml for the available components you can build this way.
Once bootstrapped, you can then rebuild just the component you care about using this:
mvn clean install -f build/pom.xml -P${component.name}
If you prefer to do things iteratively (one component at a time) you can check the order to build in http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml or http://anonsvn.jboss.org/repos/jbosstools/trunk/build/pom.xml http://anonsvn.jboss.org/repos/jbosstools/trunk/build/pom.xml
h3. Build/Test Single Component or Module
If you have already bootstrapped a build by compiling all its dependencies (as in the previous section), you can now (re)build a whole component, or individual plugins/tests/features, using this:
mvn clean install -f build/pom.xml -P${component.name}
where ${component.name} is component's root folder name. For instance to build jmx component:
mvn clean install -f build/pom.xml -Pjmx
Or to build but skip *running* tests:
mvn clean install -f build/pom.xml -Pjmx -Dmaven.test.skip=true
You can also build individual plugins or collections of plugins by simply running maven in that artifact's folder:
cd ~/jbosstools-src/common/plugins; mvn clean install
cd ~/jbosstools-src/common/tests/org.jboss.tools.common.model.ui.test; mvn clean install
Putting it all together, here's how you could build & test the JMX Core plugin:
mvn clean install -f build/parent/pom.xml # parent pom
mvn clean install -f build/pom.xml -Pjmx-bootstrap -Dmaven.test.skip # bootstrap deps
mvn clean install -f jmx/plugins/org.jboss.tools.jmx.core/pom.xml # rebuild plugin
mvn clean install -f jmx/tests/org.jboss.tools.jmx.core.test/pom.xml # rebuild & run test
----
h3. Running and Debugging Tests
To debug tests, you can read the console output produced by Maven, or you can https://www.jboss.org//tools/docs/testing#remote enable remote debugging using Eclipse.
To control how Maven will behave and how much console output will be produced, here are some useful flags:
-fae :: fail at end
-fn :: fail never
-q :: quieter output
-e :: if error occurs, dump stack into console
-X :: debug output (should log to a file using
`mvn clean install -X | tee log.txt`
because output will be huge)
----
h3. Adding a Plugin To An Existing Component
Now that you can build your component, you can easily add a new plugin to that component. Here's how.
0. Make sure your new plugin compiles in your workspace. Ensure your MANIFEST.MF contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).
1. When you are satisfied, you can commit your new plugin project to SVN.
cd ~/trunk/as/plugins; \
svn add org.jboss.ide.eclipse.as.rse.core; \
svn ci -m "JBIDE-123456 Initial commit of new as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core
2. Next, add a pom.xml file to the root of your new project.
You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in MANIFEST.MF) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.
3. Build your plugin:
cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core; \
mvn3 clean install
4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:
vi ~/trunk/as/plugins/pom.xml
5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml.
vi ~/trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
6. Finally, ensure that the feature appears in all three update sites:
vi ~/trunk/as/site/site.xml # (the AS update site)
vi ~/trunk/site/site.xml # (the JBoss Tools update site) and
vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site, incl. pi4soa, Teiid, ...)
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15513]
Create a new document in JBoss Tools Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 2 months