English 中文(简体)
姓名旁观者
原标题:Error registering bean with name

现在Im处理新的模块,使用Hibernate和泉水,这一技术需要解决这一辅助设备,我在使用服务器时,寻找这方面的建议,I m 发现错误。

     SRVE0180I: [RbsAdapterWeb] [/IVRAdapterWeb] [Servlet.LOG]: Loading Spring root WebApplicationContext
[11/21/11 13:00:46:709 WST] 778b4480 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader  Loading XML bean definitions from class path resource [applicationContext.xml]
[11/21/11 13:00:46:763 WST] 778b4480 ContextLoader E org.springframework.web.context.ContextLoader  Context initialization failed
[11/21/11 13:00:46:774 WST] 778b4480 ContextLoader E org.springframework.web.context.ContextLoader  TRAS0014I: È stata registrata la seguente eccezione org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name  hcm  defined in class path resource [applicationContext.xml]: Class that bean class [it.elsag.echannel.utils.HCMAbstraction] depends on not found; nested exception is java.lang.NoClassDefFoundError: it/elsag/echannel/common/PasswordRulesException
java.lang.NoClassDefFoundError: it/elsag/echannel/common/PasswordRulesException

当然,没有发现显示该类别,但当我通过检查耳机发现该类别时,就会发现。

任何人都能够帮助我检查此事,我会站在网吧。

预先感谢

最佳回答

Try to check the path of the deployed EAR on the server. If you re working with Network Deployment, should be something like: {WAS_INSTALL_DIR}/profiles/{deployment_manager_dir}/config/cells/{cell_name}/applications/{app}.ear

If it s a standalone WAS, it s something like: {WAS_INSTALL_DIR}/profiles/{your_profile_dir}/config/cells/{cell_name}/applications/{app}.ear

如果你看见<>strong>, 耳,你就会发现问题。

在网络部署中,这种错误往往由于耳朵的更新而发生,增加了某些类别,而更新的则与点子同步。 同步使服务器停机坪重新启用。

问题回答

错误意味着,你的 app子在班子里找上班。

为了纠正这种情况,将班次放在一边,确保课堂包含你们期望的内容。 使用该守则:

public static String determineClassPath( ClassLoader cLoader ) {

    List<URL> urls = getClassPath( cLoader );
    StringBuilder buffer = new StringBuilder();
    String delim = "";

    for( URL url : urls ) {
        buffer.append( delim ).append( url );
        delim = "
";
    }

    return buffer.toString().trim();
}

public static List<URL> getClassPath( ClassLoader cLoader ) {

    List<ClassLoader> loaders = new ArrayList<ClassLoader>();
    ClassLoader current = cLoader;
    while( current != null ) {
        loaders.add( 0, current );
        current = current.getParent();
    }

    List<URL> result = new ArrayList<URL>();
    for( ClassLoader loader : loaders ) {
        determineClassPath( result, loader );
    }

    return result;
}

public static List<URL> getURLs( ClassLoader cLoader ) {

    List<URL> result = new ArrayList<URL>();
    determineClassPath( result, cLoader );

    return result;
}

private static boolean DEBUG_CLASSPATH = true;

private static void determineClassPath( List<URL> result, ClassLoader cLoader ) {
    if( DEBUG_CLASSPATH ) {
        Logger log = LoggerFactory.getLogger( JavaUtils.class );
        log.debug( "ClassLoader {}", cLoader );
    }

    if( cLoader instanceof URLClassLoader ) {
        URLClassLoader cl = (URLClassLoader) cLoader;

        URL [] urls = cl.getURLs();
        if( urls == null ) { // On IBM/WebSphere this can be null
            urls = new URL[0];
        }

        if( DEBUG_CLASSPATH ) {
            Logger log = LoggerFactory.getLogger( JavaUtils.class );
            log.debug( "    URLs: {}", urls );
        }
        result.addAll( Arrays.asList( urls ) );
    } else if( cLoader != null ) {
        Logger log = LoggerFactory.getLogger( JavaUtils.class );
        log.warn( "Unsupported class loader " + cLoader.getClass() );
    }
}

引人注意的是:

  • Was WebSphere able to unload your application when you re-deployed?
  • How often is a class on the classpath? Make sure nothing exists twice.
  • Make sure the JARs/EARs aren t corrupt




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签