This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228563 - Error parsing Glassfish 3.1.2 Domain config XML with German Umlauts
Summary: Error parsing Glassfish 3.1.2 Domain config XML with German Umlauts
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-15 11:04 UTC by christian.hamacher
Modified: 2013-04-23 02:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
example-config with and wo error, screenshots, logs (321.22 KB, application/x-zip-compressed)
2013-04-16 10:37 UTC, christian.hamacher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description christian.hamacher 2013-04-15 11:04:26 UTC
Using umlauts when configuring glassfish (for example in a description) is no problem at all for glassfish itself. But after saving the config, it looks like netbeans has a Problem parsing it:

1. You can't start Glassfish from within Netbeans, but only using asadmin.
When you click "start", nothing happens and when you try to deploy to the instance, the script keeps pending at the point where it traces "Starting Glassfish"

2. When you try to add the existing domain as a new service in Netbeans, it says there is no admin listener enabled in the domainconfig and so it can't be used.

3. After I manually removed the umlauts from the configfile, Netbeans allowed adding the domain as usual.


I only checked the description attribute of a Properties-JNDI-resource, but it should be a general problem I guess.
Comment 1 Martin Fousek 2013-04-16 07:20:32 UTC
christian.hamacher thanks for reporting. I'm passing this issue to the GlassFish plugin which should be related component for it.
Comment 2 TomasKraus 2013-04-16 09:38:55 UTC
I need some example. Please can you attach domain.xml with those characters to this bug?
Comment 3 christian.hamacher 2013-04-16 10:37:35 UTC
Created attachment 133519 [details]
example-config with and wo error, screenshots, logs
Comment 4 TomasKraus 2013-04-17 12:07:30 UTC
I see following exception in logs:
INFO [glassfish]: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:405)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1064)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:826)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1547)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.netbeans.modules.glassfish.spi.TreeParser.readXml(TreeParser.java:91)

So looks like those characters have some issues with UTF-8 encoding. How did you get those characters into domain.xml?
Comment 5 christian.hamacher 2013-04-17 12:48:25 UTC
I just used the Glassfish admin console webapp on http 4848, added a new userdefined JNDI resource of type java.util.Properties and entered a description to it. This description contained an 'ö' as far as I remember.

On that same day this was not a problem, because I didn't restart the glassfish, but the next day when I began developing i noticed the issue as described above. Starting via asadmin was no problem but netbeans didn't want to. After removing the 'ö' manually (Notepad++) it worked fine again from Netbeans too.

For this report here I created a new domain using Netbeans and did not touch the config files by "hand", but only by using the admin console webapp.
Comment 6 TomasKraus 2013-04-17 13:01:08 UTC
I'm currently using en_US locales in my environment to make my life easy in US company. But I can try to use some set of German or Czech or Russian characters here to see what will happen.
Comment 7 TomasKraus 2013-04-17 13:37:45 UTC
A added 1st one with czech text as

<custom-resource res-type="java.util.Properties" description="Český JNDI" jndi-name="czechJNDI"
 factory-class="org.glassfish.resources.custom.factory.PropertiesFactory">
</custom-resource>

another with russian as 

<custom-resource res-type="java.util.Properties" description="Русский JNDI" jndi-name="russianJNDI"
 factory-class="org.glassfish.resources.custom.factory.PropertiesFactory">
</custom-resource>

and last one with german as

<custom-resource res-type="java.util.Properties" description="Deutsch JNDI mit hässlichen ö"
 jndi-name="germanJNDI" factory-class="org.glassfish.resources.custom.factory.PropertiesFactory">
</custom-resource>

and all of them works fine for me.

This looks like in your file there is some issue with 'ö' encoding which is probably not UTF-8.
I used GlassFish 3.1.2.2 running in en_US locales on Linux for my test. what was your environment ang GF version?
Comment 8 christian.hamacher 2013-04-17 13:52:18 UTC
GlassFish 3.1.2.2
de_DE
Windows 7 64
Comment 9 christian.hamacher 2013-04-17 16:19:26 UTC
Just tried on another Windows environment:
GlassFish 3.1.2.2
de_DE
win 8 64

--> same issue
Comment 10 TomasKraus 2013-04-17 22:02:48 UTC
I need to get access to some windows 7/8 with german locales first.
This seems to be bug in glassfish admin console which is not saving domain.xml in utf-8 under some locales. But I have to prove it before filing glassfish bug.
Comment 11 TomasKraus 2013-04-18 14:28:49 UTC
Checked into web-main:
----------------------
changeset:   250440:7eb9fd51a5d2
branch:      javaee7
summary:     #228563 - Error parsing Glassfish 3.1.2 Domain config XML with German Umlauts

I changed reader selection for SAX parser to use system default encoding.
It resolved issue with parsing domain.xml in my environment - your domain.xml no more causes an exception.
Hope it will work for you too.
Comment 12 TomasKraus 2013-04-19 11:41:55 UTC
Closing as fixed, please verify it using build from 
http://bertram2.netbeans.org:8080/job/web-main-javaee7/
Comment 13 Quality Engineering 2013-04-23 00:08:30 UTC
Integrated into 'releases', will be available in build *201304222201* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/7eb9fd51a5d2
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #228563 - Error parsing Glassfish 3.1.2 Domain config XML with German Umlauts
Comment 14 Quality Engineering 2013-04-23 02:11:35 UTC
Integrated into 'main-golden', will be available in build *201304222301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7eb9fd51a5d2
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #228563 - Error parsing Glassfish 3.1.2 Domain config XML with German Umlauts