Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol "HttpServerFactory" in IntelliJ IDEA

I am trying to create a small project concerning RESTful services. So I fire up IntelliJ IDEA and do:

New Project -> (select Java) -> (select RESTful WebService 2.2) -> check "Generate client and server code", select to download needed libraries.

Afterwards when going to the created HelloWorld class I get the following error: cannot resolve symbol "HttpServerFactory" as well as cannot resolve symbol "jersey" for this import: import com.sun.jersey.api.container.httpserver.HttpServerFactory;.

Any ideas how to solve this problem?

like image 613
user3542880 Avatar asked May 15 '14 15:05

user3542880


People also ask

What does Cannot resolve symbol mean?

The cannot find symbol error, also found under the names of symbol not found and cannot resolve symbol , is a Java compile-time error which emerges whenever there is an identifier in the source code which the compiler is unable to work out what it refers to.


1 Answers

Alternatively, change the version of the Jersey library on your Module settings page. Apparently they removed the HttpServerFactory on later versions...

To change the version, right click on your module and select 'Open Module Settings (F4)'. From there on click Libraries on the left, select jersey from the library list, then click "Change Version". v1.12 worked for me.

enter image description here

like image 119
Arca Artem Avatar answered Sep 18 '22 11:09

Arca Artem