Results 1 to 8 of 8

Thread: Perl5Matcher error

  1. #1
    Join Date
    Feb 2005
    Posts
    28

    Default Perl5Matcher error

    we're using spring aop to enhance some business methods, using the Perl5RegexpMethodPointcut class to define the pointcuts. on rare occasion, on startup, a general query we run in the webapp, that just calls a basic business method (e.g. countResults), throws an exception. the stacktrace points to Perl5RegexpMethodPointcut, line 76, and deeper down it is org.apache.oro.text.regex.Perl5Matcher throwing an ArrayIndexOutOfBoundsException (index is -1).

    the fun part, of course, is that if i run a different query, it will work fine, and from then on all queries, including the one that punted, work.

    has anyone else hit this before? this is not spring 1.2, by the way. we will upgrade in next version of our app.

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Can you post the stack trace? Also, if you are running on JDK 1.4+ try using the JdkRegexpMethodPointcut instead.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Feb 2005
    Posts
    28

    Default

    i'll see if i can grab a stack trace (it's running on a disconnected lan). meanwhile, i will switch to the jdk regexp. thanks for the advice.

  4. #4
    Join Date
    Jan 2005
    Location
    Sydney, Australia
    Posts
    32

    Default

    I'm getting what seems to be the same problem. Its intermittent - sometimes things work fine, sometimes we get this exception. I haven't done any further investigation into it yet - will pass on more details as we uncover them. For now, here is the stack trace:

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flightAvailabilityHandler' defined in class path resource [handling.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 60
    java.lang.ArrayIndexOutOfBoundsException: 60
    at org.apache.oro.text.regex.Perl5Matcher.__match(Unknown Source)
    at org.apache.oro.text.regex.Perl5Matcher.__tryExpression(Unknown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unknown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unknown Source)
    at org.springframework.aop.support.Perl5RegexpMethodPointcut.matches(Perl5RegexpMethodPointcut.java:76)
    at org.springframework.aop.support.AbstractRegexpMethodPointcut.matches(AbstractRegexpMethodPointcut.java:122)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:265)
    at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:288)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
    at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:65)
    at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:223)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:236)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:350)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:257)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:235)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
    at org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy$CglibSubclassCreator$LookupOverrideMethodInterceptor.intercept(CglibSubclassingInstantiationStrategy.java:154)
    at au.com.eb2.axsres.comm.CommunicationHandlerFactory$$EnhancerByCGLIB$$13e64408.createFlightAvailabilityHandler&#40;<generated>&#41;
    at au.com.eb2.axsres.comm.CommunicationHandlerFactory.getHandler&#40;CommunicationHandlerFactory.java&#58;34&#41;
    at au.com.eb2.axsres.comm.CommunicationHandlerFactory.getHandler&#40;CommunicationHandlerFactory.java&#58;146&#41;
    at au.com.eb2.axsres.qtrip.AxsResConnectionMessageService.processMessage&#40;AxsResConnectionMessageService.java&#58;38&#41;
    at sun.reflect.GeneratedMethodAccessor279.invoke&#40;Unknown Source&#41;
    at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41;
    at java.lang.reflect.Method.invoke&#40;Method.java&#58;585&#41;
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection&#40;AopUtils.java&#58;310&#41;
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint&#40;ReflectiveMethodInvocation.java&#58;155&#41;
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;122&#41;
    at au.com.eb2.shared.connection.ConnectionInterceptor.invoke&#40;ConnectionInterceptor.java&#58;79&#41;
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke&#40;JdkDynamicAopProxy.java&#58;174&#41;
    at $Proxy24.processMessage&#40;Unknown Source&#41;
    at com.eb2.qtrip.main.bullant.ConnectionMessageRequestDispatcher.dispatch&#40;ConnectionMessageRequestDispatcher.java&#58;34&#41;
    at com.eb2.qtrip.main.bullant.ThreadPoolDispatcherExecutor$1.run&#40;ThreadPoolDispatcherExecutor.java&#58;44&#41;
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask&#40;ThreadPoolExecutor.java&#58;650&#41;
    at java.util.concurrent.ThreadPoolExecutor$Worker.run&#40;ThreadPoolExecutor.java&#58;675&#41;
    at java.lang.Thread.run&#40;Thread.java&#58;595&#41;

  5. #5
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    This is very strange - it looks more like a problem in ORO than in Spring. Give it a go with JDK regex and I'll take a look at this when I have some spare time.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  6. #6
    Join Date
    Jan 2005
    Location
    Sydney, Australia
    Posts
    32

    Default

    FYI, I tried it with JDK regexp and this seems to have fixed the problem.

  7. #7
    Join Date
    Dec 2005
    Location
    Estonia
    Posts
    11

    Default

    Hello,

    I have the same problem only in my case similar exception comes from Spring jdbc package so it's not possible to switch to JDK regexp.

    It seems that this error comes if using only certain DAOs but haven't been able to find any similarity between them. Also it occurs totally randomly.

    java.lang.ArrayIndexOutOfBoundsException: 33
    at org.apache.oro.text.regex.Perl5Matcher.__repeat(Un known Source)
    at org.apache.oro.text.regex.Perl5Matcher.__match(Unk nown Source)
    at org.apache.oro.text.regex.Perl5Matcher.__tryExpres sion(Unknown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unk nown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unk nown Source)
    at org.springframework.aop.support.Perl5RegexpMethodP ointcut.matches(Perl5RegexpMethodPointcut.java:76)
    at org.springframework.aop.support.AbstractRegexpMeth odPointcut.matches(AbstractRegexpMethodPointcut.ja va:122)
    at org.springframework.aop.framework.AdvisorChainFact oryUtils.calculateInterceptorsAndDynamicIntercepti onAdvice(AdvisorChainFactoryUtils.java:77)
    at org.springframework.aop.framework.HashMapCachingAd visorChainFactory.getInterceptorsAndDynamicInterce ptionAdvice(HashMapCachingAdvisorChainFactory.java :46)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:154)
    at $Proxy1.prepareStatement(Unknown Source)
    at org.springframework.jdbc.core.PreparedStatementCre atorFactory$PreparedStatementCreatorImpl.createPre paredStatement(PreparedStatementCreatorFactory.jav a:212)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:427)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:475)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:506)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:527)
    at org.springframework.jdbc.object.SqlQuery.execute(S qlQuery.java:114)
    at org.springframework.jdbc.object.SqlQuery.execute(S qlQuery.java:201)
    at org.springframework.jdbc.object.SqlQuery.execute(S qlQuery.java:209)
    at MessageQueDaoMtImpl.getFirstMessage(MessageQueDaoM tImpl.java:262)
    at sun.reflect.GeneratedMethodAccessor46.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:284)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:155)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :122)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:56)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:174)

    Another case:
    java.lang.ArrayIndexOutOfBoundsException: 25
    at org.apache.oro.text.regex.Perl5Matcher.__repeat(Un known Source)
    at org.apache.oro.text.regex.Perl5Matcher.__match(Unk nown Source)
    at org.apache.oro.text.regex.Perl5Matcher.__tryExpres sion(Unknown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unk nown Source)
    at org.apache.oro.text.regex.Perl5Matcher.matches(Unk nown Source)
    at org.springframework.aop.support.Perl5RegexpMethodP ointcut.matches(Perl5RegexpMethodPointcut.java:76)
    at org.springframework.aop.support.AbstractRegexpMeth odPointcut.matches(AbstractRegexpMethodPointcut.ja va:122)
    at org.springframework.aop.framework.AdvisorChainFact oryUtils.calculateInterceptorsAndDynamicIntercepti onAdvice(AdvisorChainFactoryUtils.java:77)
    at org.springframework.aop.framework.HashMapCachingAd visorChainFactory.getInterceptorsAndDynamicInterce ptionAdvice(HashMapCachingAdvisorChainFactory.java :46)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:154)
    at $Proxy1.commit(Unknown Source)
    at org.springframework.jdbc.datasource.DataSourceTran sactionManager.doCommit(DataSourceTransactionManag er.java:204)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:397)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCommitTransactionAfterReturni ng(TransactionAspectSupport.java:243)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:66)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:174)
    at $Proxy33.getFirstMessage(Unknown Source)

    Is there any solution to this? I'm using Jakarta ORO 2.0.8

    Any ideas?
    Thanks!

  8. #8
    Join Date
    Dec 2005
    Location
    Estonia
    Posts
    11

    Default solution found

    Seems that problem was sharing instance of RegexpMethodPointcutAdvisor for our custom Datasource advice.

    After creating new instance of RegexpMethodPointcutAdvisor each time this error hasn't occured anymore.

Similar Threads

  1. ERROR: Context initialization failed
    By makhlo in forum Architecture
    Replies: 8
    Last Post: Jul 11th, 2008, 01:41 AM
  2. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  3. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  4. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM
  5. Replies: 4
    Last Post: Nov 5th, 2004, 03:59 AM

Posting Permissions

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