• Post Reply Bookmark Topic Watch Topic
  • New Topic

External Spring bean not being found  RSS feed

 
sam wootton
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear JavaRanch,

Thanks all for any help.

I  think / hope this is easy to solve.  I'm not that great with Spring. 

I have a BeanFactoryPostProcessor class:



In the context xml of this application (app-A) I have no bean definition.

However in the application that uses this application (i.e. app-B, has its jar in it's /lib) directory... there is a context i.e



The problem I'm having is that when building my application (app-B) that uses app-A, I get



So I have, if you like "external" bean definition, not being picked up by the application that has the BeanFactoryPostProcessor in.

Regards, Sam
 
M Khalid
Ranch Hand
Posts: 57
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should be a Bean Class which will instantiate and provide bean object.

In app-A you have not used context not have you implemented Bean Post Processor if you are trying to use Bean postProcessor.

What are you trying to achieve here? can you explain that in brief
 
sam wootton
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

I have implemented BeanFactoryPostProcessor (i copied the code snippet above). 

I have app-a (a library) which is loaded in to app-B. In app-A I have the BeanFactoryPostProcessor, but no context. I want it to use the context defined in app-B.  In app-A i do have the context (xml bean definition for myProperties)

Im only repeating what I said above - I thought it was clear?

Regards, Sam
 
sam wootton
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry that last bit should have read

In app-B i do have the context (xml bean definition for myProperties).

So:

app-A (BeanFactoryPostProcessor) with reference to myProperties bean.
app-B (the xml application conext that has myProperties). - also loads in app-A jar.

Regards, Sam
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!