Results 1 to 5 of 5

Thread: Invalid content was found starting with element 'skippable-exception-classes'

  1. #1
    Join Date
    Feb 2013
    Location
    Cracow, Poland
    Posts
    5

    Default Invalid content was found starting with element 'skippable-exception-classes'

    Code:
    <batch:step id="step_rejectedTransactionsStatus3">
    		<batch:tasklet task-executor="taskExecutor_rejectedTransactionsStatus">
    			<batch:chunk reader="reader_rejectedTransactionsStatus3" processor="processor_rejectedTransactionsStatus3" writer="writer_rejectedTransactionsStatus3" commit-interval="1">
    				<skippable-exception-classes>
    					<include class="org.springframework.batch.core.JobExecutionException"/>
    				</skippable-exception-classes>
    			</batch:chunk>
    		</batch:tasklet>
    	</batch:step>
    1)
    in line <skippable-exception-classes> above a have error:
    "cvc-complex-type.2.4.a: Invalid content was found starting with element 'skippable-exception-classes'. One of '{"http://www.springframework.org/schema/batch":reader, "http://www.springframework.org/schema/batch"rocessor, "http://
    www.springframework.org/schema/batch":writer, "http://www.springframework.org/schema/batch":skip-policy, "http://www.springframework.org/schema/batch":retry-policy, "http://www.springframework.org/schema/batch":retry-listeners, "http://
    www.springframework.org/schema/batch":streams, "http://www.springframework.org/schema/batch":skippable-exception-classes, "http://www.springframework.org/schema/batch":retryable-exception-classes, "http://www.springframework.org/schema/
    batch":listeners}' is expected."

    what's wrong with my include class?

    2)
    My writer:
    Code:
    <bean id="writer_rejectedTransactionsStatus3" class="pl.bph.rafik.jobs.rejectedtransactions.writer.RejectedTransactionsSendNotificationWriter">
    		<property name="rejectedTransactionsManager" ref="rejectedTransactionsManager" />
    		<property name="jmsManager" ref="jmsManager" />
    </bean>
    durin starting application tries connect to the jmsManager but if my JMS Queues are not available then i have errors and my application doesn't work.
    Can i use <skippable-exception-classes> to resolve this problem, and application will work properly after starting without JMS available queues?

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    1) skippable-exeception-classes is from the batch namespace...in your configuration, you need <batch:skippable-exception-classes>
    2) You can't use skips as part of the startup (which is when your error is occurring). When does the queue become available?
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  3. #3
    Join Date
    Feb 2013
    Location
    Cracow, Poland
    Posts
    5

    Default

    1) thanks, it works
    2) from time to time somebody turn off server with JMS. Then we start app and received errors that JMS is unavailable:

    14-02-2013 16:11:56.015 ERROR [ContextLoader]:{308line}-'Rafik'-Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'pidConnectionFactory' defined in URL [file:/C:/oracle/Middleware/weblogic_10.3.6/user_projects/domains/RafikDomain/autodeploy/RafikEAR/RafikWAR/WEB-INF/classes/pl/bph/rafik/config/connector/jmsConnector.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'CAJMSFactory'. Resolved ''; remaining name 'CAJMSFactory'


    we have few separate modules in this system and i want to other modules will work correctly when one module can't work becouse JMS is unavailable.

    I have jmsConnector.xml :

    Code:
    	<bean id="pidJMSJndiTemplate" class="pl.bph.rafik.connector.JndiTemplate">	<!-- lazy-init="true"  -->
    		<property name="environment" >
    			<props>
    				<prop key="java.naming.provider.url">${jms.services.pidJMSJndiTemplate.jndi.url}</prop>
    				<prop key="java.naming.factory.initial">${jms.services.pidJMSJndiTemplate.jndi.factory}</prop>
    				<prop key="java.naming.security.principal">${jms.services.pidJMSJndiTemplate.jndi.principal}</prop>
    				<prop key="java.naming.security.credentials">${jms.services.pidJMSJndiTemplate.jndi.credentials}</prop>
    			</props>
    		</property>
    	</bean>
    	
    	<bean id="pidConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">	<!-- lazy-init="true"  -->
    		<property name="jndiTemplate" ref="pidJMSJndiTemplate"/>
    		<property name="jndiName" value="${jms.services.pidJMSJndiTemplate.jndi.connectionFactory}" />
    		<!--<property name="cache" value="false" />  -->
    	</bean>
    
    	<bean id="pidQueueDestination" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">	<!-- lazy-init="true"  -->
    		<property name="jndiTemplate" ref="pidJMSJndiTemplate"/>
    		<property name="jndiName" value="${jms.services.pidJMSJndiTemplate.jndi.queueDestination}"/>
    		<!--<property name="cache" value="false" />  -->
    	</bean>
    
    	<bean id="pidJmsTemplate" name="pidJmsTemplate" class="org.springframework.jms.core.JmsTemplate" lazy-init="true">	<!-- lazy-init="true"  -->
    		<property name="connectionFactory" ref="pidConnectionFactory"/>
    		<property name="defaultDestination" ref="pidQueueDestination"/>
    		<property name="receiveTimeout" value="${jms.services.pidJMSJndiTemplate.jndi.receiveTimeout}"/>
        </bean>
    I thought when i add lazy-init="true" it helps but it doesn't.
    Last edited by pawelw; Feb 14th, 2013 at 09:18 AM.

  4. #4
    Join Date
    Feb 2013
    Location
    Cracow, Poland
    Posts
    5

    Default

    Can somebody help with 2 above?

    second problem i have is when system work correctly, putting messages to JMS and somebody restart foreign JMS server then my system loose JMS connection and i need to restart system to reconnect to JMS. Is there any idea to resolve this problem and system could reconnect automatically?

    To connect to JMS i use like you see above in code JmsTemplate class, is this good for this case?
    http://static.springsource.org/sprin...sTemplate.html

  5. #5
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    Number 2 is really a Spring Core/Integration issue and how that connection occurs. I would recommend posting in those forums to get the right people looking at your issue.
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •