[Datasource Configuration] - Caused by: javax.resource.ResourceException: Unable to get managed connection
by Sachidananda Dash
Sachidananda Dash [http://community.jboss.org/people/sachi.dash] created the discussion
"Caused by: javax.resource.ResourceException: Unable to get managed connection"
To view the discussion, visit: http://community.jboss.org/message/557048#557048
--------------------------------------------------------------
Hi friends,
*Caused by: javax.resource.ResourceException: Unable to get managed connection for softwareDepotDB*
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
at com.apple.ist.hilo.communication.ConnectionManager.getCommonConnection(ConnectionManager.java:213)
... 16 more
*Caused by: javax.resource.ResourceException: Interrupted while requesting permit! Waited 0 ms*
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:314)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
... 21 more
The scenario there is when I am trying to execute transaction for max no of threads. The threads are unable to get the connection and it gives a error.
please help me out.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557048#557048]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
[JBoss Web Services CXF] - How to share session between web service calls?
by Anand Jayaraman
Anand Jayaraman [http://community.jboss.org/people/anand201301] created the discussion
"How to share session between web service calls?"
To view the discussion, visit: http://community.jboss.org/message/557040#557040
--------------------------------------------------------------
Hi ,
I am using Jboss CXF for development.
I would like to maintain session state across web service calls.
>From CXF client stubs you can maintain session state but it holds only for calls made from that specific client proxy(say CP1). If i want to maintain the same session state across client proxies there is no straight forward way in CXF.
I was able to use HttpConduit and get cookies from it and copy it before next invocation. Something like:
HTTPConduit conduit1 = (HTTPConduit)ClientProxy.getClient(p1).getConduit(); HTTPConduit conduit2 = (HTTPConduit)ClientProxy.getClient(p2).getConduit(); conduit2.getCookies().putAll(conduit1.getCookies());
Can some one tell me if there is a better way of acheiving this using a configuration change than using copying cookies?
Regards,
Anand
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557040#557040]
Start a new discussion in JBoss Web Services CXF at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
Re: [jboss-user] [jBPM] - Joining of non-concurrent decision paths seems to be broken in 4.4
by Peter Horvath
Peter Horvath [http://community.jboss.org/people/h.peter] replied to the discussion
"Joining of non-concurrent decision paths seems to be broken in 4.4"
To view the discussion, visit: http://community.jboss.org/message/557037#557037
--------------------------------------------------------------
Hello Maciej,
Our process definition is quite large and complicated, and we added extra join nodes to prevent the diagram from becoming spaghetti-like. According to the documentation, the join node simply waits the the number of executions specified in the multiplicity attribute (or the number of incoming transitions if multiplicity is not specified) that should arrive before the it gets activated and takes the outgoing transition. This is exactly what happens in JBPM 4.3.
I understand that this change was introduced to address some edge-cases but I think - from the user's point of view - it is a regression in functionality as such usage of join nodes was valid in the previous version.
My feeling is that the assumption, that the process contains the same number of join and fork nodes on ++every+ possible+ execution paths, is not correct and may cause further problems. A lot of people with a bit more complicated process definition migh find that it breaks after the migration to the latest version of JBPM.
Regards,
Peter
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557037#557037]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
[JBoss Tools] - Create Eclipse Ecore (EMF) Models manually
by Andre Dietisheim
Andre Dietisheim [http://community.jboss.org/people/adietisheim] modified the document:
"Create Eclipse Ecore (EMF) Models manually"
To view the document, visit: http://community.jboss.org/docs/DOC-15705
--------------------------------------------------------------
h1. *Forewords*
EMF provides a runtime and tools that allow you to create ecore object models. The starting point is a model definition. It may be created out of a XML Schema (XSD), annotated java classes, etc. but you will mostly craft one by hand. This document attempts to describe the process involved in the later. It will show you the basic steps to create an ecore model implementation and give you some more advanced hints here and there.
There are a few tutorials available on http://www.eclipse.org/modeling/emf/docs/#tutorials eclipse.org, the best one so far's the one provided by http://www.vogella.de/articles/EclipseEMF/article.html Lars Vogella.
If you want to create an ecore model manually, you have different editors at hand that you may use for this matter. The most common one is the *Sample Ecore Model Editor*, but you may also use text based editors like http://wiki.eclipse.org/Emfatic Emfatic or http://www.eclipse.org/Xtext/ Xtext. There are also graphical editors around like the* http://www.eclipse.org/modeling/emft/?project=ecoretools Ecore Diagram Editor or the eUML2 Editor.*
h1. Create an EMF Project
To get started, create an empty EMF project.
http://community.jboss.org/servlet/JiveServlet/showImage/4918/new-empty-e... http://community.jboss.org/servlet/JiveServlet/downloadImage/4918/new-emp...
You'll get a new project, that's set up to work with the EMF framework. The model definitions, the *ecore* files are put into a *model* folder (not a must but a standard so far). Create a new ecore model file in this folder by selecting the folder and triggering the new ecore model wizard.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15697-11-489... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15697-11...
h1. Create the Package
If you want to create an ecore model manually, you have different editors at hand that you may use for this matter. The most common one is the *Sample Ecore Model Editor*, but you may also use text based editors like http://wiki.eclipse.org/Emfatic Emfatic or http://www.eclipse.org/Xtext/ Xtext. There are also graphical editors around like the* http://www.eclipse.org/modeling/emft/?project=ecoretools Ecore Diagram Editor or the eUML2 Editor.*
We created the empty ecore model so far, so the next step is to create a package for your model. You set its name, Ns Prefix and Ns URI.
The good practice (or at least what most modelers do) is to set them to:
* *name*: a simple term (not required to be unique)
* *Ns prefix*: ~shoretened 'java package' name (not required to be unique)
* *Ns URI*: some real (or bogus) unique URI where the scheme might be found.
h4. example
I have a plugin/module in cdo called *org.eclipse.emf.cdo.ui.defs*
The ecore model for it has the following definitions:
*name*: defs
*Ns prefix*: cdo.ui.defs
*Ns URI*: http://www.eclipse.org/emf/CDO/ui/defs/1.0.0 http://www.eclipse.org/emf/CDO/ui/defs/1.0.0
h1. Model Your Classes
You can now add classes to your package. There are usually several ways to get to the desired result, most likely the best way to find out is to get the book or error and trial. A rule of thumb is to have all classes available in your model. This is evident for ecore classes. But if your ecore classes use references to plain java types (that are not part of your ecore model in the strict sense) you'll at least need to declare those java types in the ecore model. In other words, the ecore model needs to know about all types (ecore or plain java) that are part of your model.
h4. example1
Let's say that my modeled class CDOEditorDefs has a method execute() that throws an ExecutionException. I could add that method by hand but as a matter of taste I prefer to declare that method in my model.
My model does not know anything about this exception so far, so there's no way to get the correct signature generated out of the box . I'll therefore have to declare this exception in model. I create a DataType *ExecutionException*.
create an EDataType:
http://community.jboss.org/servlet/JiveServlet/showImage/4911/declare-dat... http://community.jboss.org/servlet/JiveServlet/downloadImage/4911/declare...
Give it an instance type name so it won't be generated but is referencable:
http://community.jboss.org/servlet/JiveServlet/showImage/4913/declare-exe... http://community.jboss.org/servlet/JiveServlet/downloadImage/4913/declare...
Set the execute method (operation) to throw the ExecutionException:
http://community.jboss.org/servlet/JiveServlet/showImage/4914/declare-thr... http://community.jboss.org/servlet/JiveServlet/downloadImage/4914/declare...
The generated method now throws the given Exception:
http://community.jboss.org/servlet/JiveServlet/showImage/4915/generated-t... http://community.jboss.org/servlet/JiveServlet/downloadImage/4915/generat...
h4. example2
A very common problem is to have modeled (ecore-) classes extend Java Interfaces. For instance this could be java.lang.Comparable
The best way to achieve that is to model a class Comparable. Do not model its operation as this is just a mirror of the real java interface in the ecore-world.
Interfaces are modeled as supertypes in ecore. You therefore cannot use EDataTypes here as they cannot be supertypes of ecore classes. Nevertheless you can achieve that in a slight different manner: You model a (real) ecore class, but you set its instance type name: *java.lang.Comparable*. You can now add the Comparable class to the super type of each ecore-class that shall implement Comparable. The generator will not generate an ecore class that's called Comparable but it will include java.lang.Comparable in the interface that your ecore-classes implement.
+*Not sure I follow this example and what we're trying to illustrate. Would example code help?*+
h1. Create a Genmodel
This is mostly straight forward. Select the ecore file and create a genmodel for it. Select your ecore file and start a new *EMF Generator Model* wizard. The wizard will allow you to create a so called Generator Model that holds all settings which are important to the code generation process.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15697-11-484... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15697-11...
There are 2 settings that might be of interest to you:
'*All*' (property group when the package is selected):
- *Base Package*: the base package all ecore classes get generated to
- *Prefix*: Prefix that the factory- and package-class get
http://community.jboss.org/servlet/JiveServlet/showImage/102-15697-11-484... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15697-11...
example (still using the cdo.ui.defs example):
*Base Package*: org.eclipse.emf.cdo.ui
*Prefix*: CDOUIDefs
Package-class gets CDOUIDefsPackage, Factory gets CDOUIDefsFactory, etc. All classes get generated to the package org.eclipse.emf.cdo.ui
Further modifications you might be interested in are the suffixes of the sub-packages (the defaults creates an 'impl' package where it puts all implementation classes). It can be modified by selecting the '*Package Suffixes*' and choosing the properties '*Implementation*' and '*Interfaces*'.
The naming of the implementation- and interface-classes may be changed, too. You find those settings if you select the root-node of the tree in the genmodel-editor and choose the '*Model*' property group. You'll find 'Class Name Pattern' and 'Interface Name Pattern' among the available properties. The explanations for the values show up in the statusbar (default is '*{0}impl*' and '*{0}*').
http://community.jboss.org/servlet/JiveServlet/showImage/102-15697-11-484... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15697-11...
Once you're done defining your generator model, you simply need to generate the implementation classes. Select the package you want to generate, right click and select the implementation you want to create. You may choose among the models, the editor, the tests.
http://community.jboss.org/servlet/JiveServlet/showImage/102-15697-11-485... http://community.jboss.org/servlet/JiveServlet/downloadImage/102-15697-11...
h1. Modify the Generated Classes
Ecore is built to be modified, the basic usage-pattern is to code and generate hand-in-hand. To tell the generator not to override your modifications you need to set the javadoc-annotation to anything different than '@generated'. Good practice says that you should set it to '@generated NOT'. Good practice also tells you to annotate any manually added method by '@ADDED', but its optional though.
There is another handy that allows you to modify and get the generated code. If you want to have your code instead of the generated one, you just annotate accordingly and the generator will preserve your code. If you want the generated code, too, you'd need to create a method that has the original name + a suffix 'Gen'
example:
/**
*
* @generated NOT
*/
public void setName(String name) {
YOUR OWN CODE
}
/**
*
* @generated
*/
public void setNameGen(String name) {
GENERATOR provides the generated code in here
}
After making your modifications, you simply need to re-generate the ecore classes. (+*How?*+)
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-15705]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
15 years, 8 months
Re: [jboss-user] [jBPM Development] - JBPM-2772 retrieve business key from sub-process
by Maciej Swiderski
Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] replied to the discussion
"JBPM-2772 retrieve business key from sub-process"
To view the discussion, visit: http://community.jboss.org/message/557018#557018
--------------------------------------------------------------
Correct, I mixed parent and super/subprocess usage in jBPM. Parent is used for executions that are derived from origin such as when using fork and super/sub are used to reflect relationship between processes. My mistake.
Back to the issue, I was suggesting to allow users to provide their business key for subprocess that will be used when executing it. Please consider very simple definition that consists of subprocess:
<process name="SubProcessDocument" xmlns="http://jbpm.org/4.4/jpdl">
<start g="20,20,48,48">
<transition to="review" />
</start>
<sub-process name="review" key="#{mySubProcessBusinessKey}"
sub-process-key="SubProcessReview"
g="96,16,127,52">
<parameter-in var="document" subvar="document" />
<parameter-out var="reviewResult" subvar="result" />
<transition to="wait" />
</sub-process>
<state name="wait" g="255,16,88,52"/>
</process>
Then when subprocess is created it will assign value of mySubProcessBusinessKey to key of the execution. Of course it can in some situations cause uniqueness problems but since it is designed to be externally provided (within scope of the process definition) I would say that it is a known risk.
Does it make sense to you or am I completely lost?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557018#557018]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months