[JNDI and Naming] - Moving from 4.2.2 to AS 7
by Richard Doust
Richard Doust [https://community.jboss.org/people/rdiddly] created the discussion
"Moving from 4.2.2 to AS 7"
To view the discussion, visit: https://community.jboss.org/message/822853#822853
--------------------------------------------------------------
Hi.
I'm in the process of moving a rather large application from JBoss 4.2.2 to JBoss AS 7.1.1. There's an awful lot to know about when doing this, and sometimes the documentation can seem to lead one around in circles. I'm sure if I was starting this from scratch, I'd do better, but I'm not, so, I have a question:
I have a single EJB jar containing Entity and Session beans. Many of the Session beans use the services of other Session beans. To gain access to those beans, they use JNDI, using a utility method like the following:
EJBUtil:
public static AccountManagerLocalHome getAccountManagerLocalHome()
throws NamingException {
return HomeFactory.getHomeFactoryInstance().lookupAccountManagerLocalHome();
}
HomeFactory:
public AccountManagerLocalHome lookupAccountManagerLocalHome()
throws NamingException {
return (AccountManagerLocalHome) lookupLocal(
JNDINames.ACCOUNTMANAGER_LOCAL, AccountManagerLocalHome.class);
}
JNDINames.java:
public interface JNDINames {
public final static String ACCOUNTMANAGER_LOCAL = "java:comp/env/ejb/AccountManagerLocal";
}
In JBoss startup log I find this:
15:50:10,268 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-10) JNDI bindings for session bean named AccountManager in deployment unit subdeployment "appEJB-1.0-SNAPSHOT.jar" of deployment "appEar-1.0-SNAPSHOT.ear" are as follows:
java:global/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemote
java:app/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemote
java:module/AccountManager!com.app.session.accountManager.AccountManagerRemote
java:jboss/exported/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemote
java:global/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemoteHome
java:app/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemoteHome
java:module/AccountManager!com.app.session.accountManager.AccountManagerRemoteHome
java:jboss/exported/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerRemoteHome
java:global/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerLocal
java:app/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerLocal
java:module/AccountManager!com.app.session.accountManager.AccountManagerLocal
java:global/appEar-1.0-SNAPSHOT/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerLocalHome
java:app/appEJB-1.0-SNAPSHOT/AccountManager!com.app.session.accountManager.AccountManagerLocalHome
java:module/AccountManager!com.app.session.accountManager.AccountManagerLocalHome
Given the above, and assuming that this code would only be called from beans within this jar, would the code work if I were to change JNDINames.java to:
public interface JNDINames {
public final static String ACCOUNTMANAGER_LOCAL = "java:app/AccountManager!com.app.session.accountManager.AccountManagerLocal";
}
Would there be a better/easier way to make this change? Keep in mind, I have about 50 session beans and about 30 entity beans, so the fewer changes the better.
Thanks in advance.
Richard
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/822853#822853]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 6 months
[JBoss Tools] - JBosstoolsVisualEditorFAQ
by Yahor Radtsevich
Yahor Radtsevich [https://community.jboss.org/people/yradtsevich] modified the document:
"JBosstoolsVisualEditorFAQ"
To view the document, visit: https://community.jboss.org/docs/DOC-10862
--------------------------------------------------------------
*Q: Which platforms are supported by* *Visual Editor?*
*A:* The list of supported platforms (and their IDs):
* Windows with Java 32-bit (win32.win32.x86)
* Windows with Java 64-bit (win32.win32.x86_64) - Experimental support is available in JBoss Tools 4.1.0.Beta1/2 and JBoss Developer Studio 7.0.0.Beta1/2.
To enable it, you need to install XULRunner from this update site: http://download.jboss.org/jbosstools/builds/staging/xulrunner-1.9.2_win64... http://download.jboss.org/jbosstools/builds/staging/xulrunner-1.9.2_win64....
If you cannot start Eclipse after this installation, you may use –Dorg.jboss.tools.vpe.loadxulrunner=false option as described in the next question.
Please comment https://issues.jboss.org/browse/JBIDE-2720 this JIRA if something went wrong.
* Linux x86 (gtk.linux.x86)
* Linux x86-64 (gtk.linux.x86_64)
* Mac OS X Cocoa with Java 32-bit (cocoa.macosx.x86)
* Mac OS X Carbon with Java 32-bit (carbon.macosx.x86) [not supported by JBoss Tools 3.3.0 and later, JBDS 5.0 and later]
In brief, Java 64-bit is supported on Linux only, on all other systems Visual Editor requires Java 32-bit.
*Q: Eclipse crashes when I use Visual Editor, what can I do?*
*A:* This may happen in JBoss Tools 3.3.0.M2 and above with Eclipse 3.7.0 due to https://issues.jboss.org/browse/JBIDE-9144 the WebKit and XULRunner conflict. You can disable Visual Editor by adding the option –Dorg.jboss.tools.vpe.loadxulrunner=false to the eclipse.ini (or jbdevstudio.ini if you use JBoss Developer Studio).
*Q: Visual Editor does not start under Linux*
*A:* Linux users may need to do the following to get the visual editor to work correctly on their machines.
* The Visual Page Editor (before JBoss Tools 3.1.0.M4) requires the library libstdc++.so.5. This library is contained in the compat-libstdc++-33.i386 package.
* To install this package on Fedora Core or Red Hat Enterprise Linux run the following command:
yum install compat-libstdc++-33.i386
** On any other rpm based distributions download libstdc++.so.5 and run the following command:
rpm -Uvh compat-libstdc++-33.i386
** On Debian and Debian based distributions (e.g. Ubuntu) run the following command:
apt-get install libstdc++5
* In case you have the library installed and you still have issue with starting the visual page editor then close all browser views/editors and leave one visual page editor open and restart eclipse. This should force a load of the right XULRunner viewer.
*Q: Visual Editor doesn't start at any platform and shows message 'The VPE editor can't be run because your system environment needs to be changed slightly'*
*A:* Check if you version of JBoss Developer Studio/JBoss Tools is compatible with you version of Eclipse, see the compatibility matrix https://community.jboss.org/docs/DOC-14297 http://www.jboss.org/community/wiki/Matrixofsupportedplatformsruntimesand...
*Q: Visual Editor starts OK, but the following message dialog appears:*
https://community.jboss.org/servlet/JiveServlet/showImage/102-10862-50-19... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-10862-5...
*A:* Some functionality of Visual Editor may not work if a project doesn't have org.jboss.tools.jsf.jsfnature or org.jboss.tools.jst.web.kb.kbnature in .project configuration. To fix this problem and turn off the message box execute next steps:
* Right mouse button click on a project in Package Explorer.
* Select +Configure -> Add JSF Capabilities+ from the context menu.
* Configure your project using +Add JSF Capabilities+ wizard and press Finish.
*P.S.* If you are sure that your project does not need JSF capabilities, just disable this message box by checking "+Do not show this dialog again!+" checkbox.
*Q: Visual Part doesn't start and "XPCOM error -2147467259" is shown*
*A:* Something bad happened with buildin xulrunner. To check it you should:
* Go to Eclipse -> Help -> About -> Installation Details... -> Configuration
* find +org.eclipse.swt.browser.XULRunnerPath+ and open this path in terminal
* try xulrunner.exe -version or ./xulrunner -version and it should show what is needed for XR to work
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-10862]
Create a new document in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 6 months
[jBPM] - jBPM 5.4: How to end process after timer event
by Juri Zeisler
Juri Zeisler [https://community.jboss.org/people/juriz] created the discussion
"jBPM 5.4: How to end process after timer event"
To view the discussion, visit: https://community.jboss.org/message/822903#822903
--------------------------------------------------------------
Hey,
i am a newbie in jBPM. I am trying to end my process after a timer triggered.
The process is a kind of an approvement thing. So the the process can by ended by an user task or after the timer triggers without reaction of the user.
The intersting thing is that on a clean database the pocess works the first time. So the timer triggers and the process ends. But when I start a new
instance of ther process and the timer triges an exception occurs.
The stacktrace is:
org.drools.RuntimeDroolsException: Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalProcessInstanceAction@4a152d1e
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:995)
at org.drools.impl.StatefulKnowledgeSessionImpl.executeQueuedActions(StatefulKnowledgeSessionImpl.java:866)
at org.jbpm.process.instance.event.DefaultSignalManager.signalEvent(DefaultSignalManager.java:90)
at org.jbpm.process.instance.timer.TimerManager$ProcessJob.execute(TimerManager.java:323)
at org.drools.time.SelfRemovalJob.execute(SelfRemovalJob.java:15)
at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:51)
at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:14)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Do I miss something?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/822903#822903]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 6 months
[jBPM] - when running on Tomcat6: Unable to locate Spring NamespaceHandler for XML schema namespace [urn:hornetq]
by Arnold H
Arnold H [https://community.jboss.org/people/arnoldH] created the discussion
"when running on Tomcat6: Unable to locate Spring NamespaceHandler for XML schema namespace [urn:hornetq]"
To view the discussion, visit: https://community.jboss.org/message/822738#822738
--------------------------------------------------------------
I have read the docs about integrating JBPM5.4 on Tomcat, and tried to go throuth the steps.It seemed that a JMS implementation(such as HornetQ) should be needed, but when I tried to install HornetQ(2.3.0.Final) on Tomcat6, error messages appeared.
I tried to follow the source code of org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.java and org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.java, and it seemed that spring framework had to find a class that implements the interface NamespaceHandler, and should have been stored in a file(such as META-INF/spring.handlers). And then I followed the source code of hornetq-2.3.0.Final, and didn't find any class that had implemented the interface of NamespaceHandler.
Here are my questions:
1. Must HornetQ(or some other JMS implementation) be installed?
2. If HornetQ must be installed, where is the class that implements the interface NamespaceHandler ? or is there any documentation that describes the steps of integrating HornetQ with Tomcat?
I posted a thread in the forum of HornetQ, but no one responded. So I came here for help, can anybody give some light? thanks a lot!
The error messages are listed as below:
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [urn:hornetq]
Offending resource: file [E:\Try_JBPM5\tomcat\webapps\hornetq\WEB-INF\classes\hornetq-configuration.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1337)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/822738#822738]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 6 months