[JBoss/Spring Integration] - Re: Is it SpringLifecycleInterceptor or just me?
by Arno Werr
Thank you Ales for your comments and suggestions.
I followed your advise and tried to update my JBoss 4.0.4 GA and run it with your Spring integration solution.
Unfortunately, my experience in this endeavor is mainly negative.
Firstly, I tried to install on my existing JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000) jboss-EJB-3.0_RC8-FD.
Downloaded jboss-EJB-3.0_RC8-FD.zip. Not good. The problem - according to accompanying INSTALL.html there should be client jars (fairly reasonable attitude):
| 15. Copy jboss-ejb3-client.jar from the lib/ directory of the distribution to jboss-4.0.x/client
| 17. Copy hibernate-client.jar from the lib/ directory of the distribution to jboss-4.0.x/client
| etc.
|
Here's the content of the RC8-FD lib directory:
| ./ejb3-entity-cache-service.xml
| ./hibernate-entitymanager.jar
| ./ejb3-interceptors-aop.xml
| ./ejb3-persistence.jar
| ./quartz-ra.rar
| ./hibernate-annotations.jar
| ./ejb3.deployer
| ./ejb3.deployer/jboss-ejb3x.jar
| ./ejb3.deployer/jboss-ejb3.jar
| ./ejb3.deployer/META-INF
| ./ejb3.deployer/META-INF/persistence.properties
| ./ejb3.deployer/META-INF/jboss-service.xml
| ./ejb3.deployer/jboss-annotations-ejb3.jar
| ./quartz-all-1.5.2.jar
| ./jboss-remoting.jar
| ./hibernate3.jar
| ./ejb3-clustered-sfsbcache-service.xml
| ./jboss-aop-jdk50.deployer
| ./jboss-aop-jdk50.deployer/trove.jar
| ./jboss-aop-jdk50.deployer/base-aop.xml
| ./jboss-aop-jdk50.deployer/META-INF
| ./jboss-aop-jdk50.deployer/META-INF/jboss-service.xml
| ./jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar
| ./jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar
|
Well, I do not see any client jar here... and without proper client jars my attempts to communicate with the server using standalone client are doomed. I need client and I need RMI.
Unable to install jboss-EJB-3.0_RC8-FD.zip (client jars problem) I decided to download the whole shebang hoping that this ejb update might be incorporated (wrong call!) with the newest version of the JBoss 4.0.4
http://umn.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.4.GA-Patch1-ins...
Installed ejb3 version domain all, installed your jboss-spring-jdk5.deployer and tried with my test application.
Yak! This patched server throws
| 08:05:25,377 INFO [[/web]] Loading Spring root WebApplicationContext
| 08:05:25,597 INFO [CollectionFactory] JDK 1.4+ collections available
| 08:05:25,874 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
| 08:05:26,427 INFO [DefaultNamespaceHandlerResolver] Ignoring handler [org.springframework.jndi.config.JndiNamespaceHandler]: class not found
| 08:05:26,492 INFO [DefaultNamespaceHandlerResolver] Ignoring handler [org.springframework.web.servlet.config.MvcNamespaceHandler]: class not found
| 08:05:26,623 INFO [XmlWebApplicationContext] Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [facade]; root of BeanFactory hierarchy
| 08:05:26,727 INFO [XmlWebApplicationContext] 1 beans defined in application context [Root WebApplicationContext]
| 08:05:26,770 INFO [XmlWebApplicationContext] Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@937e20]
| 08:05:26,779 INFO [XmlWebApplicationContext] Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@e229be]
| 08:05:26,824 INFO [UiApplicationContextUtils] Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@10a063d]
| 08:05:26,831 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [facade]; root of BeanFactory hierarchy]
| 08:05:27,179 ERROR [ContextLoader] Context initialization failed
| org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facade' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jspring not bound
| javax.naming.NameNotFoundException: jspring not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
| at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
| at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
| at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71)
| at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
| at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125)...
|
| 08:05:27,197 ERROR [[/web]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
| org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facade' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jspring not bound
| javax.naming.NameNotFoundException: jspring not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
|
Classic bad behavior of an application server towards Spring. Server loads web part of the app first and after that - is trying to load EJBs.
I tried to rectify this. My usual declaration in applicationContext.xml
for local facade looks like this.
| <bean
| id="facade"
| class="&JndiObjectFactoryBean;">
| <property
| name="jndiName"
| value="&facadeJndi;" />
| </bean>
|
I tried to to force the factory bean to generate a proxy object to stand in for the real JNDI object and disabled lookupOnStartup. New version:
| <bean
| id="facade"
| class="&JndiObjectFactoryBean;">
| <property
| name="jndiName"
| value="&facadeJndi;" />
| <property
| name="lookupOnStartup"
| value="false" />
| <property
| name="proxyInterface"
| value="&facadeLocal;" />
| </bean>
|
Rebuild, reran. Nada! The same exception. For me it's no show, so I decided to revert back to my old, original JBoss 4.0.4 which does not recognize SpringLifecycleInterceptor but works well with my version of the same thing extending SpringPassivationInterceptor. This my original installation works good with Spring - first it loads EJBs and only then - web layer.
Yet not all that good.
On my web layer I have two very simple jsps with JSTL - index.jsp and home.jsp.
index -
| <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
| <c:redirect url="/home.htm"/>
|
home.jsp has the following very simple JSTL statements:
| <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
| ...
| <ul>
| <c:forEach items="${specials}" var="special">
| <li>${special.departFrom.name} - ${special.arriveAt.name} from ${special.cost}</li>
| </c:forEach>
| </ul>
|
The problem is with jsp generation JBoss 4.0.4 on my machine generates index.jsp correctly transforming jstl into something like this
| _jspx_th_c_redirect_0.setPageContext(_jspx_page_context);
| _jspx_th_c_redirect_0.setParent(null);
| _jspx_th_c_redirect_0.setUrl("/home.htm");
| int _jspx_eval_c_redirect_0 = _jspx_th_c_redirect_0.doStartTag();
| if (_jspx_th_c_redirect_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
| _jspx_tagPool_c_redirect_url_nobody.reuse(_jspx_th_c_redirect_0);
| return true;
| }
| _jspx_tagPool_c_redirect_url_nobody.reuse(_jspx_th_c_redirect_0);
| return false;
|
But in case with home.jsp it fails to process forEach.
| do {
| out.write("\n");
| out.write("\t\t<li>");
| out.write("${special.departFrom.name}");
| out.write(' ');
| out.write('-');
| out.write(' ');
| out.write("${special.arriveAt.name}");
| out.write(" from\n");
| out.write("\t\t$");
| out.write("${special.cost}");
| out.write("</li>\n");
| out.write("\t");
| int evalDoAfterBody = _jspx_th_c_forEach_0.doAfterBody();
| if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
| and on generated html I am getting
| <ul> <li>${special.departFrom.name} - ${special.arriveAt.name} from ${special.cost}</li>
|
| </ul>
|
Tried the same pages on JBoss 4.0.2 and Sun AS 8 - no problem - pages properly generated.
I noticed that in your sample application you don't use JSTL. Why is that? Is this because
JBoss 4.0.4x way of handling of JSTL statements kinda 'patchy'? It's also strange that 4.0.4 does not have usual web-console - only jmx, at least on my installations. Well, strange, strange...
So, for now I have a disfunctional web layer (controllers working fine though) and properly working facade, service, dao, EJB3 persistence on my old JBoss 4.0.4 - not patched.
Any ideas are highly appreciated ;)
Cheers,
Arno
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961871#3961871
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961871
17 years, 9 months
[Installation, Configuration & Deployment] - Re: problem trying to deploy a simple helloworldejb.jar
by rsood72
09:04:17,649 INFO [SARDeployer] Started jboss.system:service=ServiceDeployer
| 09:04:17,649 INFO [Server] Core system initialized
| 09:04:17,659 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
| -3.2.3/server/default/conf/jboss-service.xml
| 09:04:20,193 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resour
| ce:log4j.xml
| 09:04:25,721 INFO [STDOUT] Apache Tomcat/4.1.29
| 09:04:26,843 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on port 8080
| 09:04:26,873 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on port 8080
| 09:04:27,103 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
| 09:04:27,123 INFO [JkMain] Jk running ID=0 time=0/80 config=null
| 09:20:24,239 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
| 2.3/server/default/deploy/HelloWorldEJB.jar
| org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
| d, see above for error messages.
| at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
| at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:324)
| at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
| nDispatcher.java:284)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
| tScanner.java:302)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
| canner.java:476)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| doScan(AbstractDeploymentScanner.java:201)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| loop(AbstractDeploymentScanner.java:212)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| run(AbstractDeploymentScanner.java:191)
Contents of my ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
| <ejb-jar>
| <display-name>
| HelloWorldEJB</display-name>
| <enterprise-beans>
| <session>
| <ejb-name>Hello</ejb-name>
| <home>examples.HelloHome</home>
| <remote>examples.Hello</remote>
| <ejb-class>examples.HelloBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| </session>
| </enterprise-beans>
| </ejb-jar>
contents of my jboss.xml
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
|
| <jboss>
|
| <enterprise-beans>
|
| <!--
| To add beans that you have deployment descriptor info for, add
| a file to your XDoclet merge directory called jboss-beans.xml that contains
| the <session></session>, <entity></entity> and <message-driven></message-driven>
| markup for those beans.
| -->
|
| <session>
| <ejb-name>Hello</ejb-name>
| <jndi-name>ejb/Hello</jndi-name>
|
| </session>
|
| <!--
| write a merge file jboss-webservices.ent for webservice-description
| -->
|
| </enterprise-beans>
|
| <resource-managers>
| </resource-managers>
|
| <!--
| | for container settings, you can merge in jboss-container.xml
| | this can contain <invoker-proxy-bindings/> and <container-configurations/>
| -->
|
| </jboss>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961870#3961870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961870
17 years, 9 months
[Management, JMX/JBoss] - Re: [JBOSS 4] Pb Schedulers
by bobunny
For informtion, I found this warning several times :
* ATTENTION: The scheduler instance only allows to run one schedule at a time.
* Therefore when you want to run two schedules create to instances with this
* MBean. Suggested Object Name for the MBean are:
* :service=Scheduler,schedule=<you schedule name>
* This way you should not run into a name conflict.
So i tried to apply this recommandation, and changed my configuration file into something like this :
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=CrestScheduler">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
| <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
| <attribute name="InitialStartDate">0</attribute>
| <attribute name="SchedulePeriod">300000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| </mbean>
|
instead of
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerCrest">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
| <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
| <attribute name="InitialStartDate">0</attribute>
| <attribute name="SchedulePeriod">300000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| </mbean>
|
But this change has no success.
Then I also tried to allocate a different Timer for each scheduler with a dependance like below :
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerCrest">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">jpea.dataimport.crest.CrestFileImporter</attribute>
| <attribute name="SchedulableArguments">import, crest_(cas|dbv)_.+\.csv$, DataimportPool, DEV</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
| <attribute name="InitialStartDate">0</attribute>
| <attribute name="SchedulePeriod">300000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| <depends>
| <mbean code="javax.management.timer.Timer" name="jboss:service=myTimer1"/>
| </depends>
| </mbean>
| <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=SchedulerBony">
| <attribute name="StartAtStartup">true</attribute>
| <attribute name="SchedulableClass">jpea.dataimport.triparty.bony.BonyFileImporter</attribute>
| <attribute name="SchedulableArguments">import, bony_(i|d)_.+\.txt$, DataimportPool, DEV</attribute>
| <attribute name="SchedulableArgumentTypes">java.lang.String, java.lang.String, java.lang.String, java.lang.String</attribute>
| <attribute name="InitialStartDate">0</attribute>
| <attribute name="SchedulePeriod">300000</attribute>
| <attribute name="InitialRepetitions">-1</attribute>
| <depends>
| <mbean code="javax.management.timer.Timer" name="jboss:service=myTimer2"/>
| </depends>
|
| </mbean>
|
That didn't change anything...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961869#3961869
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961869
17 years, 9 months