redhat-developer / redhat-developer/vscode-java

Cannot find the class file for javax.servlet.http.HttpServletResponse.

Open
#2,123 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

  • Operating System: Ubuntu 20.04
  • JDK version: openjdk 11.0.11
  • Visual Studio Code version: 1.60.1
  • Java extension version: v0.82.0

I have a java project that uses gradle. This project worked well with the java extension for a long time.

Now, when I run './gradlew assemble' from the command line, the project builds successfully.

When I load the project in VSCode I get the following errors...

{
	"resource": "/myproj//java_server",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": "0",
	"severity": 8,
	"message": "The project was not built since its build path is incomplete. Cannot find the class file for javax.servlet.http.HttpServletResponse. Fix the build path then try building this project",
	"source": "Java",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}
{
	"resource": "/myproj/java_server/src/main/java/framework/MessageHandler.java",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": "16777540",
	"severity": 8,
	"message": "The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files",
	"source": "Java",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 2
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported project state in VS Code with JDK 11 and the listed Java extension version, then compare it with the successful ./gradlew assemble command. Inspect how the extension handles the Gradle project's build path and the reference from src/main/java/framework/MessageHandler.java; done means the project loads without the missing javax.servlet.http.HttpServletResponse diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.