Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apache-tika-3.0/3.0.0-r2: cve remediation #38403

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Dec 26, 2024

Signed-off-by: Dentrax <furkan.turkal@chainguard.dev>
Copy link
Member

@developer-guy developer-guy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be merged as it breaks application:
2024/12/29 21:41:59 WARN Exception in thread "main" java.lang.NoSuchMethodError: 'int org.eclipse.jetty.util.URIUtil.getDefaultPortForScheme(java.lang.String)' name="start server and verify endpoint"

Signed-off-by: Dentrax <furkan.turkal@chainguard.dev>
Copy link
Contributor Author

octo-sts bot commented Dec 29, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

no suitable constructor found for PathResource(java.nio.file.Path)
constructor org.eclipse.jetty.util.resource.PathResource.PathResource(java.net.URI) is not applicable

• Error Category: Build/Compilation

• Failure Point: Maven test compilation phase in tika-grpc module

• Root Cause Analysis: The test class PipesBiDirectionalStreamingIntegrationTest is trying to use a constructor for PathResource that either doesn't exist or isn't accessible. The PathResource class from Jetty expects a URI constructor but is being passed a Path object.

• Suggested Fix:

  1. Modify line 97 in PipesBiDirectionalStreamingIntegrationTest.java to convert the Path to URI before creating PathResource:
// Change from:
new PathResource(path)

// To:
new PathResource(path.toUri())

• Explanation:

  • The Jetty PathResource class's public constructor accepts a URI
  • Java's Path objects can be converted to URIs using the toUri() method
  • This conversion maintains the file system path information while providing the correct type for the constructor

• Additional Notes:

  • This appears to be a compatibility issue with Jetty's API requirements
  • The error occurs in test code, not production code
  • Similar issues have been seen when working with Jetty's resource handling
  • The fix maintains the intended functionality while satisfying type requirements

• References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants