[EJB 3.0 Development] - Exception while deployed EJB jar
by eshwar rao
eshwar rao [http://community.jboss.org/people/eshwaronline] created the discussion
"Exception while deployed EJB jar"
To view the discussion, visit: http://community.jboss.org/message/556332#556332
--------------------------------------------------------------
Can someone please help me resolve the issue mentioned below. am using JBOSS 5 and EJB3.0
Thanks in advance,
Eshwar
11:15:35,375 INFO [EJBContainer] STOPPED EJB: com.giantslogik.sfbs.ejb.impl.ACLBean ejbName: ACLBean
11:15:35,375 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:jar=sfbs-basic.jar,name=ACLBean,service=EJB3 state=Create
java.lang.NullPointerException
at org.jboss.deployment.plugin.MappedDeploymentEndpointResolver.getEndpointInfo(MappedDeploymentEndpointResolver.java:65)
at org.jboss.ejb3.deployers.JBoss5DeploymentScope.getEjbContainer(JBoss5DeploymentScope.java:165)
at org.jboss.ejb3.deployers.JBoss5DeploymentScope.getEjbContainer(JBoss5DeploymentScope.java:233)
at org.jboss.ejb3.Ejb3Deployment.getEjbContainer(Ejb3Deployment.java:389)
at org.jboss.ejb3.Ejb3Deployment.getEjbJndiName(Ejb3Deployment.java:395)
at org.jboss.ejb3.EJBContainer.getEjbJndiName(EJBContainer.java:1526)
at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:72)
at org.jboss.ejb3.EJBContainer.lockedStart(EJBContainer.java:900)
at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:200)
at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:577)
at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:192)
at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/556332#556332]
Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month
Re: [jboss-dev-forums] [jBPM Development] - Some questions about the script execution code
by Michael Wohlfart
Michael Wohlfart [http://community.jboss.org/people/mwohlf] replied to the discussion
"Some questions about the script execution code"
To view the discussion, visit: http://community.jboss.org/message/556294#556294
--------------------------------------------------------------
Hi HuiSheng,
thanks a lot for your reply,
> [..]
> And I find both evaluateExpression() and evaluateScript() are using evaluate() internal. There is no different between them. So we just using evaluateExpression() to do all of work about eval script. Maybe sometimes it become much confused.
the problem I see here is that a script might get executed with the default expression language instead with the default script language, this part of the source is indeed very confusing can't we just remove the evaluateExpression() and evaluateScript() and in general use the evaluate() method and throw an exception if the execution language is not specified, this would be more in line with the rest of the code in my opinion.
> [...]
> 2.EnvironmentBinding had not finished yet. We just removed all of IllegalStateException in jBPM-4.4 in order to get more feeback from community. I think we could finish it in the next version, like achieve the put() method to store data into process variable.
I didn't think of this, but it would be a cool feature to have a groovy script write to process variables
> [...]
> 3.Did we have to achieve the readContext and writeContext. In which scenarios we should use them? If they are not neccessary, I want to deprecated them in the next version, so we could delete them in the future.
I also don't see an urgent need for them, the read contexts are hard coded now as far as I understand?
The write context would be where ever the variable is declared?
> [...]
> 4.How should we refactor TaskContext and ExecutionContext. A long times ago, Tom said he want to refacter the TaskContext and ExecutionContext, But he didn't make it more clearly. if we could make a good plan, we could finish this work by ourselves.
Could they be used to have access to task scoped and execution scoped variables, at least this would make sense to me :-/ right now the TaskContext just gives access to the task itself, so a script can do stuff like task.getVariable('varname')
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/556294#556294]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month
[jBPM Development] - Some questions about the script execution code
by Michael Wohlfart
Michael Wohlfart [http://community.jboss.org/people/mwohlf] created the discussion
"Some questions about the script execution code"
To view the discussion, visit: http://community.jboss.org/message/556227#556227
--------------------------------------------------------------
I am currently going through the source code of jBPM4 because I am having some problems with custom script execution in my process definitions. Unfortunately the code base is not very well documented for my taste, some source files contain nothing more than copyright and author comment, which leads me to ask here for the programmer's intention. I know the lead devs left the project but hopefully there is someone who knows what's going on, or at least we can have a discussion about how to handle things.
* As far as I understand the ScriptManager is the central component in executing scripts but is also used for evaluating expressions, why is the method "evaluateScript()" never called? To me its seems like Scripts are evaluated as Expressions in the "evaluateExpression()" method thus the defaultScriptLanguage is never used, is this intentional or just a bug?
* Why is the EnvironmentBindings not "storing" any variables in the put() method , isn't this necessary for some scripting languages, couldn't this easily be achieved by extending javax.script.SimpleBindings, or is this a wanted behavior for some reason I don't understand?
* The Constructor for EnvironmentBindings has parameters for readContext and writeContext but they are not used, is this not yet implemented or is this deprecated?
* I came across the TaskContext and basically what I try to do is having access to the TaskContext in my scripts, unfortunately the TaskContext is only used in the MailListener. Scripts seems to be executen within the ExecutionContext is there any reason for not having the TaskContext when executing Scripts?
I am willing to do some work on this in the future because I think jbpm4 is a great framework but I need some input before hacking along...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/556227#556227]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month
Re: [jboss-dev-forums] [jBPM Development] - E-mail attachments
by Erki Kriks
Erki Kriks [http://community.jboss.org/people/krixerx] replied to the discussion
"E-mail attachments"
To view the discussion, visit: http://community.jboss.org/message/556207#556207
--------------------------------------------------------------
I found easy solution. It's not nice but it works.
i - number of attachments.
<decision name="sendEmailDecision">
<transition to="sendEmailWith1Attachment">
<condition expr="#{i == 1}"/>
</transition>
<transition to="sendEmailWith2Attachments">
<condition expr="#{i == 2}"/>
</transition>
<transition to="sendEmailWith3Attachments">
<condition expr="#{i == 3}"/>
</transition>
<transition to="end"/>
</decision>
<mail name="sendEmailWith1Attachment">
...
<attachments>
<attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/>
</attachments>
<transition to="end"/>
</mail>
<mail name="sendEmailWith2Attachments">
...
<attachments>
<attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/>
<attachment file="#{attachmentAddresses.get(1)}" mime-type="txt/xml" name="#{attachmentNames.get(1)}"/>
</attachments>
<transition to="end"/>
</mail>
<mail name="sendEmailWith3Attachments">
...
<attachments>
<attachment file="#{attachmentAddresses.get(0)}" mime-type="txt/xml" name="#{attachmentNames.get(0)}"/>
<attachment file="#{attachmentAddresses.get(1)}" mime-type="txt/xml" name="#{attachmentNames.get(1)}"/>
<attachment file="#{attachmentAddresses.get(2)}" mime-type="txt/xml" name="#{attachmentNames.get(2)}"/>
</attachments>
<transition to="end"/>
</mail>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/556207#556207]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month
Re: [jboss-dev-forums] [EJB 3.0 Development] - Deferring instance creation/injection to CDI
by Andrew Rubinger
Andrew Rubinger [http://community.jboss.org/people/ALRubinger] replied to the discussion
"Deferring instance creation/injection to CDI"
To view the discussion, visit: http://community.jboss.org/message/556161#556161
--------------------------------------------------------------
> Marius Bogoevici wrote:
>
> Restarting the discussion. In summary, what Weld/CDI needs is:
>
> 1) EJB defers instance creation to an external component
> - Weld deployer sets the instantiator components that will:
> a) invoke the applicable CDI constructor of the EJB class
> b) apply decorators on the EJB
> c) *not* apply interceptors on the EJB - for now, this remains a responsibility of the EJB container
I believe I've now released something which accounts for this.
http://github.com/jbossejb3/jboss-ejb3-bean-instantiator http://github.com/jbossejb3/jboss-ejb3-bean-instantiator
The above has been released as 1.0.0-alpha-1 and integrated into ejb3-core (ie. we now use the abstraction for EJB bean instance creation). This has not yet been integrated into AS yet (as that relies upon a release of core, which is a formal release chain).
The general idea is that you create an implementation of the SPI, and create an MC bean called NAME_BEAN_INSTANCE_INSTANTIATOR from
http://github.com/jbossejb3/jboss-ejb3-bean-instantiator/blob/master/spi/... http://github.com/jbossejb3/jboss-ejb3-bean-instantiator/blob/master/spi/...
Once you do this, the deployer impl will pick it up and wire things along such that the EJBContainer uses it. So make one artifact which implements jboss-ejb3-instantiator-spi, and inside it put the impl class and a META-INF/weld-bean-instantiator-jboss-beans.xml which may look like:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Declares a EJB3 Bean Instantiator
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="org.jboss.ejb3.bean.BeanInstantiator"
class="org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator" />
</deployment>
Check out the layout of the jboss-ejb3-instantiator-impl module for our current legacy impl. Basically you'll be writing the same thing. :)
Also note that we currently don't support any construction parameters. ejb3-core doesn't have any available to pass along. So even though the contract accepts construction params, I'm passing in Object[]{}. If that needs to be addressed...let me know and we'll figure something.
> Marius Bogoevici wrote:
>
> 2) EJB container provides a hook for preprocessing interceptors after instantiation. The main reason is that EJB interceptors may be CDI-injected
> (note: could we reuse the same mechanism as for EJB instantiation, since it boils down to producing an instance of the class? )
I'm pretty sure we could do this too. We have this bit of code, though I haven't verified if it's currently used or cruft:
public Object createInterceptor(Class<?> interceptorClass) throws InstantiationException, IllegalAccessException
{
Object instance = interceptorClass.newInstance();
InterceptorInjector interceptorInjector = interceptorInjectors.get(interceptorClass);
assert interceptorInjector != null : "interceptorInjector not found for " + interceptorClass;
interceptorInjector.inject(null, instance);
return instance;
}
Plenty of room in there to both abstract away the instantiation or give some post-instantiation callback before the instance is returned.
S,
ALR
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/556161#556161]
Start a new discussion in EJB 3.0 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month