Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.
This repository was archived by the owner on May 28, 2018. It is now read-only.

Some Web containers don't support context.getRealPath #304

Closed
@glassfishrobot

Description

@glassfishrobot

Some Web containers, like Weblogic, do not support ServletContext.getRealPath
for deployed web applications, null values are returned. So the default
configuration for scanning class files in /WEB-INF/classes and /WEB-INF/lib does
not work.

However, Servlet.getResource(), returns file-based URLs, at least for Weblogic,
from which the resolved paths for /WEB-INF/classes and /WEB-INF/lib can be obtained.

See the email here for more details:

https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=508

If the getRealPath("/WEB-INF/classes") returns null then try the
getResource("/WEB-INF/classes) and if it returns a file-based URL then extract
the path. Otherwise thrown an exception saying the the default servlet
configuration cannot be supported.

Environment

Operating System: All
Platform: Sun

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions