[jBPM] - Re: Spring JBpm 4.3 loading a custom IdentitySession
by Dámaris Suárez
Dámaris Suárez [http://community.jboss.org/people/dhamaris] created the discussion
"Re: Spring JBpm 4.3 loading a custom IdentitySession"
To view the discussion, visit: http://community.jboss.org/message/603187#603187
--------------------------------------------------------------
How did you do to avoid the IdentityService null?
I've been struggling with that for weeks, I'm using jbpm 4.4 and have the default configuration, that is:
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<!-- <import resource="jbpm.default.cfg.xml" /> -->
<import resource="jbpm.tx.spring.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.console.cfg.xml" />
<import resource="jbpm.jobexecutor.cfg.xml" />
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine, spring"
write-context="">
<script-language name="juel"
factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
</script-manager>
<transaction-context>
<object class="identitySession" />
</transaction-context>
<hibernate-session current="true" />
</jbpm-configuration>
I tried to initialize identityService adding it as a bean in applicationContext-process file, like this:
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
Any ideas?
Thanks
Dámaris.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/603187#603187]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
JSF/CDI Managed Bean injecting remote EJB
by fernando@lozano.eti.br
Hi there,
I'm trying to make a JSF app call a remote EJB. This EJB is in the same
JBoss AS 6.1 instance but was deployed as a standalone EJB-JAR. I wish I
could use @Inject or @EJB to inject the remote EJB proxy into the managed
bean, but it isn't working.
Here's the remote interface
package exemplo;
@Remote
public interface ClienteDAO
{
List listaCidades();
}
And the EJB
package exemplo;
@Stateless
public class ClienteEJB implements ClienteDAO
{
// no other annotations
You see, plain defaults. I can see from jmx-console my EJB is deployed and
bound to ClienteEJB/remote on the global JNDI namespace. JBoss logs also
show everything is fine when deploying the EJB-JAR file:
18:57:16,905 INFO
[org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] Binding
the following Entries in Global JNDI:
ClienteEJB/remote - EJB3.x Default Remote Business Interface
ClienteEJB/remote-exemplo.ClienteDAO - EJB3.x Remote Business Interface
Now here's the managed bean:
package exemplo;
@Named("clientes")
@RequestScoped
public class ConsultaClientes implements java.io.Serializable {
@EJB
private ClienteDAO dao;
// no other annotations
When I deploy the WAR containing this, JBoss logs show the error:
18:51:39,619 ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelController] Error
installing to Real:
name=vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war
state=PreReal mode=Manual requiredState=Real:
org.jboss.deployers.spi.DeploymentException: Error during deploy:
vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war
..
Caused by: java.lang.RuntimeException: Could not resolve @EJB reference:
[EJB Reference: beanInterface 'exemplo.ClienteDAO', beanName 'null',
mappedName 'null', lookupName 'null', owning unit
'AbstractVFSDeploymentContext@1040164109{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}']
for environment entry: env/exemplo.ConsultaClientes/dao in unit
AbstractVFSDeploymentContext@1040164109{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}
I tried adding attribute mappedName to the @EJB annotation. But jboss logs
show:
18:53:46,011 WARN
[org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] Unresolved
references exist in
JBossWebMetaData:[#web-app:AnnotatedEJBReferenceMetaData{name=exemplo.ConsultaClientes/dao,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=ClienteEJB/remote,resolved-jndi-name=null,beanInterface=interface
exemplo.ClienteDAO}]
18:53:46,097 INFO
[org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy,
ctxPath=/clientes
And when I try to run the web app I get the error:
javax.servlet.ServletException: Could not resolve reference [EJB
Reference: beanInterface 'exemplo.ClienteDAO', beanName '', mappedName
'null'] in
AbstractVFSDeploymentContext@1131335075{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}
javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
root cause
org.jboss.ejb3.ejbref.resolver.spi.UnresolvableReferenceException: Could
not resolve reference [EJB Reference: beanInterface 'exemplo.ClienteDAO',
beanName '', mappedName 'null'] in
AbstractVFSDeploymentContext@1131335075{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}
org.jboss.ejb3.ejbref.resolver.ejb30.impl.ScopedEJBReferenceResolver.resolveEjb(ScopedEJBReferenceResolver.java:80)
I also tried providing a jboss-web.xml file:
env/exemplo.ConsultaClientes/dao
ClienteEJB/remote
But it also doesn't work. I get the error on jboss logs:
18:58:48,735 ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelController] Error
installing to Real:
name=vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war
state=PreReal mode=Manual requiredState=Real:
org.jboss.deployers.spi.DeploymentException: Error during deploy:
vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war
..
Caused by: java.lang.RuntimeException: Could not resolve @EJB reference:
[EJB Reference: beanInterface 'exemplo.ClienteDAO', beanName 'null',
mappedName 'null', lookupName 'null', owning unit
'AbstractVFSDeploymentContext@405139541{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}']
for environment entry: env/exemplo.ConsultaClientes/dao in unit
AbstractVFSDeploymentContext@405139541{vfs:///home/lozano/cursos/labs-jbossas6-adm/jboss-6.1.0.Final/server/default/deploy/clientes.war}
I tried other @EJB attributes but nothing seem to work. The only way I
found to make this work so far was explicit looking for my EJB:
@Named("clientes")
@RequestScoped
public class ConsultaClientes implements java.io.Serializable {
private ClienteDAO dao;
@PostConstruct
public void inicializa() throws NamingException {
InitialContext ctx = new InitialContext();
dao = (ClienteDAO)ctx.lookup("ClienteEJB/remote");
}
So, is there a way to make @EJB work to inject a Remote EJB (from the same
JBoss AS 6.1 instance) deployed as a stand-aline EJB-JAR into a Managed
Bean inside it's own WAR, without packaging both as part of the same EAR?
[]s, Fernando Lozano
14 years, 5 months
JAX-RS x EJB-JAR
by fernando@lozano.eti.br
Hi there,
If I hava an EJB class with JAX-RS annotations packaged as a WAR file (JEE
6 Web Profile) remote clients can use the REST service. But if I package
this EJB class in a stand-alone EJB-JAR or in an WAR, is the REST service
supposed to work?
[]s, Fernando Lozano
14 years, 5 months
[JBoss Tools] - Tips for reporting errors against an Eclipse Plugin
by Max Rydahl Andersen
Max Rydahl Andersen [http://community.jboss.org/people/maxandersen] modified the document:
"Tips for reporting errors against an Eclipse Plugin"
To view the document, visit: http://community.jboss.org/docs/DOC-17304
--------------------------------------------------------------
We got a lot of people using our milestones of JBoss Tools and Developer Studio and I get asked from time to time how to best report on issues they spot/find. I've started this article to outline some of the tips & tricks around this.
Note: I’m not covering “obvious” things like actually opening a bug in jira, take screenshots and do what you can to write down the minimal steps to reproduce it and provide information like which version, OS etc. you are using - this article is about getting access to more internal details of Eclipse/Java to help.
h1. General Issues
When something fails in Eclipse it is very likely it’s log file has information about what caused the problem.
The log file is located in /.metadata/.log.
Eclipse.org has more info about this file at http://wiki.eclipse.org/FAQ_Where_can_I_find_that_elusive_.log_file%3F http://wiki.eclipse.org/FAQ_Where_can_I_find_that_elusive_.log_file%3F
In JBoss Tools we’ve made it even simpler to gather this file and a few other pieces of information in a zip file.
Goto Help > Report a problem and a dialog will show up where you can fill in details of what caused the problem. When you press ‘Finish’ a .zip file will be generated which contains the log file, Eclipse system properties and your comment.
You can attach this zip file to the related jira issue.
h1. Freezes or slowness
In case Eclipse freezes or some operation is taking exceedingly long time to complete getting a thread dump is immensly useful. Luckily recent versions of Java comes with two tools that help makes this a breeze to get: jps and jstack.
h2. jps/jstack in short
jps -v
jstack <pid found via jps> > <jira-id>.dump.txt
Attach the .txt file to the related jira.
h2. jps/stack details
jps provides you with info about the java process id of the virtual machines running on your machine.
Here is what jps shows on my machine currently:
[max@greybeard ~]$ jps
255
261
2295
264
4734 Jps
4381
3261
In many cases you don’t have that many processes running and can easily guess which one is the one you are looking for (Tip: the higher the number, the newer the process).
In case you want to get some more details you can use jps -v to get more details, here is as small snippet of what it shows for me:
[max@greybeard ~]$ jps -v
255 -Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m
-Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m
-Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
4869 Jps -Dapplication.home=/Library/Java/JavaVirtualMachines/1.6.0_26-
b03-383.jdk/Contents/Home -Xms8m[max@greybeard ~]
This should give you enough details to pin down which process you are looking for.
Once you found it note down the process id - in my case above it is 255.
Then you use jstack <pid> to get the threaddump, below is a small snippet of how that will look like:
[max@greybeard ~]$ jstack 255
2011-10-26 10:10:31
Full thread dump Java HotSpot(TM) Client VM (20.1-b02-383 mixed mode):
"Attach Listener" daemon prio=9 tid=0000000003b8b400 nid=0xb1731000 waiting on condition [0000000000000000]
java.lang.Thread.State: RUNNABLE
"Worker-52" prio=5 tid=0000000003e83400 nid=0xb20c7000 in Object.wait() [00000000b20c6000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
- locked <00000000084188a0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)
"Worker-50" prio=5 tid=000000000366e400 nid=0xb26d5000 in Object.wait() [00000000b26d4000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
- locked <00000000084188a0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)
...
...
This content is what we would be interested in.
To get it to us the simplest thing is to pipe it to a file and attach it to the jira.
Tip: put the jira ID into the name of the file for easy identification/tracking.
jstack 255 > JBIDE-12345.dump.txt
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-17304]
Create a new document in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
14 years, 5 months