4 Replies Latest reply: Feb 16, 2013 1:42 PM by tinker321 RSS

    WebLogic 11g:  Virtual Directories:  BeanAlreadyExistsException

    tinker321
      Hi;

      I'm trying to deploy a legacy servlet application that worked fine in WebLogic 9.2, has remained unchanged since then, but now throws a BeanAlreadyExistsException.

      The stack trace starts off with
      weblogic.application.ModuleException: Unmarshaller failed
      And goes all of the way down to:
      Caused By: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists: "weblogic.j2ee.descriptor.wl.VirtualDirectoryMappingBeanImpl@f825809c(/VirtualDirectoryMappings[[CompoundKey: /images/**.jpg*.gif*.ico/css/**.css]])"
      This is my webLogic.xml.

      <?xml version="1.0" encoding="UTF-8"?>
      <wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
      
        <wls:virtual-directory-mapping>
          <wls:local-path>/apps1/bea/user_projects/domains/acme/common</wls:local-path>
          <wls:url-pattern>/images/*</wls:url-pattern>
          <wls:url-pattern>*.jpg</wls:url-pattern>
          <wls:url-pattern>*.gif</wls:url-pattern>
          <wls:url-pattern>*.ico</wls:url-pattern>
          <wls:url-pattern>/css/*</wls:url-pattern>
          <wls:url-pattern>*.css</wls:url-pattern>
        </wls:virtual-directory-mapping>
      
        <wls:virtual-directory-mapping>
          <wls:local-path>C:\resources\acme</wls:local-path>
          <wls:url-pattern>/images/*</wls:url-pattern>
          <wls:url-pattern>*.jpg</wls:url-pattern>
          <wls:url-pattern>*.gif</wls:url-pattern>
          <wls:url-pattern>*.ico</wls:url-pattern>
          <wls:url-pattern>/css/*</wls:url-pattern>
          <wls:url-pattern>*.css</wls:url-pattern>
        </wls:virtual-directory-mapping>
      
       
      
        <wls:context-root>acme</wls:context-root>
      
      </wls:weblogic-web-app>
      The exceptions stopped when I removed the second virtual directory mapping, but I need it. Is there anyway to put it back?


      Thanks Steve