Bug 462828 - DefaultPersistenceProviderResolver: Bug when reading META-INF/services
Summary: DefaultPersistenceProviderResolver: Bug when reading META-INF/services
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-23 06:17 EDT by Thomas Meyer CLA
Modified: 2022-06-09 10:08 EDT (History)
0 users

See Also:


Attachments
Always read with UTF8 (1.37 KB, patch)
2015-03-23 07:12 EDT, Thomas Meyer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Meyer CLA 2015-03-23 06:17:46 EDT
I'm currently looking at the implementation of the Persistence API from:
http://git.eclipse.org/c/eclipselink/javax.persistence.git/

There is a bug in the 
javax.persistence.spi.PersistenceProviderResolverHolder.DefaultPersistenceProviderResolver.addProviderNames(URL, Collection<ProviderName>)

file:
src/javax/persistence/spi/PersistenceProviderResolverHolder.java

According to the JavaDoc of the ServiceLoader class, the services file
must be encoded in UTF-8:

http://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html

So when running with "file.encoding=IBM-273" the service class is
getting read from above service file with the incorrect encoding and
later the class cannot be found!

I think the correct fix would be to either use the ServiceLoader class
or always read the file with encoding UTF-8.
Comment 1 Thomas Meyer CLA 2015-03-23 07:12:44 EDT
Created attachment 251824 [details]
Always read with UTF8
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:08:30 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink