1

次の例外が発生します。

Build path is incomplete. Cannot find class file for com/hexgen/core/IHexGenDictionaryBased

これは、上記の例外が発生する行です。

<context:component-scan base-package="com.hexgen.api.facade" />

これは完全な XML ファイルです。

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:sec="http://www.springframework.org/schema/security"
    xsi:schemaLocation="
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">

    <sec:global-method-security pre-post-annotations="enabled"
                                secured-annotations="enabled"
                                authentication-manager-ref="authenticationManager"
                                proxy-target-class="true">
        <sec:expression-handler ref="expressionHandler"/>
    </sec:global-method-security>

    <bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
        <property name="permissionEvaluator" ref="hexgenPermissionEvaluator" />
    </bean>

    <bean id="hexgenPermissionEvaluator" class="com.hexgen.api.facade.security.HexGenPermissionEvaluator"/>

    <context:component-scan base-package="com.hexgen.api.facade" />
    <mvc:annotation-driven />
    <context:annotation-config />
</beans>

これを修正するために私がしなければならないことを誰かが説明できますか?

4

2 に答える 2

1

com/hexgen/core/IHexGenDictionaryBasedクラス (またはその .class ファイル) がどこであっても、その場所がビルド パス (またはクラスパス) 上にある必要があることを確認する必要があります。たとえば、他の hexgen-core.jar にある場合は、必ずビルド パス (Eclipse を使用) またはクラスパス (-cpパラメーターを使用) に追加してください。

他のプロジェクト ディレクトリにあるファイルを/srcSpring プロジェクトのソース ディレクトリとして追加すると、すべてのcoreクラスが自動的にクラスパスに配置されます。

于 2013-05-09T11:42:11.200 に答える
1

APIとコアの両方に共通のパッケージをコンポーネントスキャンで確認する必要があると思います。

<context:component-scan base-package="com.hexgen.api.facade" />beに変更すると<context:component-scan base-package="com.hexgen" />、見つからないコア クラスを取得する必要があります。

于 2013-05-09T11:31:54.197 に答える