Announcement Announcement Module
Collapse
No announcement yet.
Can not find beans-config.xml files in *.jar in weblogic 9.2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can not find beans-config.xml files in *.jar in weblogic 9.2

    For some reason, we have to pack out beans-config files in jar files.

    We use these codes to initial ApplicationContext
    Code:
    String[] configLocations = {"classpath*:tw/**/bean/bean-config-*.xml"};
    ApplicationContext springContext = new ClassPathXmlApplicationContext(configLocations);
    When we deploy webapp to Tomcat 5.5.23, this works fine.
    But when we deploy to Weblogic 9.2, we can not get the config files in jars.

    We also found that
    if we replace spring.jar from 2.0.6 to 1.2.9, everything is fine.


    ps. we had also tried using PathMatchingResourcePatternResolver class to locate some resources, weblogic 9.2 with spring 2.0.6 give us IOException error when we tried to get some resources in jar files.

    Why can't we use new version of Spring?

  • #2
    The working of classpath*: relies heavily on the classloader implementation of the underlying application server. But I have to admit it is quite strange that it works for Spring 1.2.9.

    Comment


    • #3
      Exception got in weblogic

      this is the exception I got in weblogic
      is this message enough? can someone tell me why?
      Thx a lot..

      Code:
           Loading spring config files..
      org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [classpath*:service/**/
      config/bean/bean-config-*.xml]; nested exception is java.io.FileNotFoundException: File not found
      Caused by: java.io.FileNotFoundException: File not found
              at java.util.zip.ZipFile.open(Ljava.lang.String;I)I(Native Method)
              at java.util.zip.ZipFile.<init>(Ljava.io.File;I)V(Unknown Source)
              at java.util.jar.JarFile.<init>(JarFile.java:132)
              at java.util.jar.JarFile.<init>(JarFile.java:70)
              at org.springframework.core.io.support.PathMatchingResourcePatternResolv
      er.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:409)
              at org.springframework.core.io.support.PathMatchingResourcePatternResolv
      er.findPathMatchingResources(PathMatchingResourcePatternResolver.java:320)
              at org.springframework.core.io.support.PathMatchingResourcePatternResolv
      er.getResources(PathMatchingResourcePatternResolver.java:244)
              at org.springframework.context.support.AbstractApplicationContext.getRes
      ources(AbstractApplicationContext.java:867)
              at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
      r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:146)
              at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
      r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)
              at org.springframework.context.support.AbstractXmlApplicationContext.loa
      dBeanDefinitions(AbstractXmlApplicationContext.java:112)
              at org.springframework.context.support.AbstractXmlApplicationContext.loa
      dBeanDefinitions(AbstractXmlApplicationContext.java:79)
              at org.springframework.context.support.AbstractRefreshableApplicationCon
      text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
              at org.springframework.context.support.AbstractApplicationContext.obtain
      FreshBeanFactory(AbstractApplicationContext.java:389)
              at org.springframework.context.support.AbstractApplicationContext.refres
      h(AbstractApplicationContext.java:324)
              at org.springframework.context.support.ClassPathXmlApplicationContext.<i
      nit>(ClassPathXmlApplicationContext.java:91)
              at org.springframework.context.support.ClassPathXmlApplicationContext.<i
      nit>(ClassPathXmlApplicationContext.java:75)
              at tw.com.sysview.athena.mvc.servlet.listener.ServletContextListenerImpl
      .contextInitialized(Ljavax.servlet.ServletContextEvent;)V(Unknown Source)
              at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run
      (EventsManager.java:376)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
      dSubject.java:321)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
      121)
              at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(Eve
      ntsManager.java:82)
              at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
      pServletContext.java:1609)
              at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletCon
      text.java:2764)
              at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.jav
      a:889)
              at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
              at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleSta
      teDriver.java:204)
              at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
      river.java:26)
              at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStat
      eDriver.java:60)
              at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedMod
      uleDriver.java:200)
              at weblogic.application.internal.flow.ModuleListenerInvoker.start(Module
      ListenerInvoker.java:117)
              at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleSta
      teDriver.java:204)

      Comment

      Working...
      X