[Snowdrop] - Re: Accessing spring beans that are deployed in a war.

Bas Ven <[email protected]>
Newsgroups gmane.comp.java.jboss.user
Message-ID <[email protected]>
Bas Ven [https://community.jboss.org/people/batter] created the discussion

"Re: Accessing spring beans that are deployed in a war."

To view the discussion, visit: https://community.jboss.org/message/829987#829987

--------------------------------------------------------------
I got sportsclub working after I went to github to get the latest version of it.  

Like I said, I got past the stacktrace, it is just the the spring beans are always null although I know the beans I am asking for have been instantiated since my spring application is working fine:


> | 
>  | @Spring(bean = "commanderServer", jndiName = "SpringCommander") |
> | 
>  | private commander.server.CommanderServer commanderServer; |
> | public String getCommanderServer(){ |
> |     String status = "Did not get a server object"; |
> |     try { |
> |         if ( commanderServer != null){  *<== Always null* |
> |             status = "Hey I got something"; |
> |         } |
> |     } catch (Exception e) { |
> |         status = e.getLocalizedMessage(); |
> |     } |
> |     return status; |
> 
> | 
>  | } |
> 

One difference I have is that my EJB's live in one ear and the Spring beans in a separate war, each having their own jars.  Not sure if this bean injection has a container (as in each ear, war etc) or JVM scope.
The spring beans are created in a java class that has the @Configuration annotation and the beans themselves are annotated with the @Bean annotation, like this:


> @Configuration
> public class MyConfiguration{
> 
>      @Bean
>      public MyInterface MyBean(){
>           return new MyInterfaceImpl();
>      }
> 
>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829987#829987]

Start a new discussion in Snowdrop at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.