同じデータベースオブジェクトを使用している2つの異なるアプリケーション(サイト+一部のcronユーティリティ)があります。別のライブラリに移動し、アプリケーションではhibernate.configurationファイルだけを残しました。Hibernate + Spring MVC:外部オブジェクトライブラリ
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="mail.xxx.com" />
<property name="username" value="xxx" />
<property name="password" value="xxx" />
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
<prop key="mail.smtp.ssl.trust">*</prop>
</props>
</property>
</bean>
<bean id="notificationsService" class="de.crm.NotificationsService">
<property name="sender" ref="mailSender" />
<property name="properties" ref="notificationsServiceProperties" />
</bean>
<bean id="notificationsServiceProperties" class="de.crm.objects.properties.NotificationsServiceProperties">
<property name="name" value="xxx" />
<property name="email" value="xxx" />
</bean>
だからここでの主な問題は、それがde.crmを見ることができない。
さて、問題は、私はJavaMailSender使用して、いくつかの電子メール通知サービスを持って、それが春のコンフィギュレーション・ファイルで定義された性質を持っているということです.objects.properties.NotificationsServicePropertiesクラスは外部ライブラリで定義されているため、プロジェクトはエクスポート時に失敗します。
外部ライブラリにプロパティクラスを残して修正する方法はありますか? ありがとうございます
UPD#1:外部ライブラリのSpringのオブジェクトを@Autowiredアノテーションで使用することはできますか?
外部パスはビルドパスに追加されるのか、クラスパスに配置された外部パスです(読み込むことができます)。 – Rocky
ビルドパス設定で外部ライブラリとして外部jarファイルを追加しました – nKognito