eclipse-ee4j / glassfish-hk2

Dynamic dependency injection framework

Home Page:https://eclipse-ee4j.github.io/glassfish-hk2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start glassfish server in Windows environment

hussainnm opened this issue · comments

As part of #499 the following code was added which does not run as expected in a Windows environment

this.resourceBase = resourceBase.endsWith(File.separator) ? resourceBase : resourceBase + File.separatorChar;

The File.separator returned in the Windows environment is a backslash (\) whereas the RESOURCE_BASE is META-INF/hk2-locator/ hence it selects the else part and the resourceBase becomes META-INF/hk2-locator/\ which is invalid. Due to this the descriptors are not read in the Windows environment.

Proposed fix:
Change File.separator and File.separatorChar to / since the files are on the classpath and not on the filesystem.