1

Today I want to ask question about spring and newInstance() method.

I'm using TyrusProject(generaly websockets in java). I created EndPoint bean and Server bean. Server depends on endpoint.

Its constructor looks like this:

Server(String path, int port, Class<?> endpoint)

And there is problem. EndPoint implements ApplicationContextAware, to get applicationContext. It is set at first, but then server creates it's own instance of endpoint and I get NullPointerException.

Is there any way I can do something about it?
Thanks in advance.

Berrigan
  • 438
  • 4
  • 23
  • 1
    See [my writeup here](http://stackoverflow.com/a/19896871/1189885). My general advice would be to look at `@Configurable` if you're stuck with Tyrus and to see whether the Spring WebSocket support with Spring Boot might not be an easier approach. – chrylis -cautiouslyoptimistic- Jul 25 '15 at 20:57
  • Propably it'd be better to use Spring WebSocket. Thanks a lot. – Berrigan Jul 25 '15 at 21:18

0 Answers0