Showing posts with label GlassFish. Show all posts
Showing posts with label GlassFish. Show all posts

Friday, December 4, 2015

[GlassFish][Resolved] WebService Client Generation Error with JDK8

Error message:
java.lang.AssertionError: org.xml.sax.SAXParseException; systemId: bundle://158.0:1/com/sun/tools/xjc/reader/ xmlschema/bindinfo/binding.xsd; lineNumber: 52; columnNumber: 88; schema_reference: 無法讀取綱要文件 'xjc.xsd', 因為 accessExternalSchema 屬性設定的限制,所以不允許 'bundle' 存取。
My Operating System : Windows 7
JDK version : 8
GlassFish Version: 4
IDE : NetBean IDE 8.0.2
I got same problem of this article and the solved with the methods provide in the answers:
http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8

However, what  i did is used all of 3 methods  shown below and hope this article can be a simple reference.

Method 1 / Step1 

Check any update for your GlassFish Software. if any, download it.


Method 2 / Step2

Create a file named "jaxp.properties" in your "libs" folder in java jdk installation directory (there is an example path:)

C:\Program Files (x86)\Java\jdk1.8.0_51\lib

and then paste the code inside it:
javax.xml.accessExternalSchema = all


Method 3 / Step3

Modify domain.xml in your GlassFish server path :
<path>/glassfish/domains/domain1/config/domain.xml
and here is my example:
C:\GlassFish4\glassfish\domains\domain1\config\domain.xml
then add, <jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>under the <java-config>  tag
<jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>


Step4

Restart your GlassFish server and IDE to apply the changes.

Reference:

http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8

[GlassFish][Resolved] ERROR: Error parsing system bundle export statement: (org.osgi.framework.BundleException: Exported package names cannot be zero length.

Error :
ERROR: Error parsing system bundle export statement: org.osgi.framework; version=1.6.0, org.osgi.framework.launch; version=1.0.0, org.osgi.framework.wiring; version=1.0.0, org.osgi.framework.startlevel; version=1.0.0, org.osgi.framework.hooks.bundle; version=1.0.0, org.osgi.framework.hooks.resolver; version=1.0.0, org.osgi.framework.hooks.service; version=1.1.0, org.osgi.framework.hooks.weaving; version=1.0.0, org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.startlevel; version=1.1.0, org.osgi.service.url; version=1.0.0, org.osgi.util.tracker; version=1.5.0, , org.glassfish.embeddable;org.glassfish.embeddable.spi;version=3.1.1 (org.osgi.framework.BundleException: Exported package names cannot be zero length.)
My JDK version: 1.8.0_51
GlassFish version :3.1.1
Operating system : Windows 7


Check your java developer kit version and also the GlassFish Server version. If you are using Java 8, it looks do not work with GlassFish Server 3.1.1. You need to downgrade to install Java 6 or 7 or upgrade GlassFish version to 4.

For me, i download  the GlassFish 4 version to install:
https://glassfish.java.net/download-archive.html
http://download.java.net/glassfish/4.0/release/glassfish-4.0-windows.exe

And installed the GlassFish 4 at directory "C:\GlassFish4" and don't forget to add this as the server instance of your project:


Reference:

http://stackoverflow.com/questions/26578426/glassfish-3-1-returns-an-error-when-started-unable-to-start-server-due-following