Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7403991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:11:29+00:00 2026-05-29T05:11:29+00:00

I have two different applications (site + some cron utility) that are using the

  • 0

I have two different applications (site + some cron utility) that are using the same database objects. I moved them into separate library, and in the applications I left only hibernate.configuration files.

Now, the problem is that I have some email notification service that uses JavaMailSender and it have properties defined in spring configuration file:

<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>

So the main problem here that it can’t see de.crm.objects.properties.NotificationsServiceProperties class because it is defined in external library and the project fails at export.

Is there any way to leave the properties class in external library and fix it?
Thank you

UPD#1: Is it possible to use objects from external library Spring’s with @Autowired annotation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:11:30+00:00Added an answer on May 29, 2026 at 5:11 am
    So the main problem here that it can't see de.crm.objects.properties.NotificationsServiceProperties class because
    

    it is defined in external library and the project fails at export.

    Spring cannot recognize a class/library if it is not included in the project’s classpath. So you need to ensure that your library either internal or external, is included in classpath.

    UPD#1: Is it possible to use objects from external library Spring's with @Autowired annotation?
    

    @Autowired only supplies those objects which are present in spring context. If a class is outside spring context, even if it is included in classpath, it will not be recognized by @Autowired.

    EDIT

    First, add the class (for example, foo.Bar) to your classpath.

    Second, add a new bean definition in your spring configuration xml:

    <bean class="foo.Bar"></bean>
    

    Now, you can access this object using @Autowired:

    public class SomeOtherClassInSpringContext {
        @Autowired
        Bar myBar;
    }
    

    P.S. If you haven’t already done so, you also need to apply <context:annotation-config/> and <context:component-scan base-package="path.to.your.classes"/> in order to tell spring that you have configured some of your classes with annotations.

    For more information, refer to Spring docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different applications and I am using GroupLab Networking to communicate between
I run foo.com. I have two different applications that live in foo.com: one is
I have two web applications in the same solution. They both use different membership/profile
I have application in VB.net that have two different form (Form1 and Form2). Now
i have two .net web application and they ara running on different domain same
I have two different grid controls on the same form. They share the same
I have two specs from two different hosts I am using: (a) Dedicated server
I have this two sharepoint web application that resides on the same server with
I have two separate web applications, both in the same intranet. One of the
I have two *.sql files that I use when creating a new web site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.