File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Glassfish/NetBeans/beans.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Glassfish/NetBeans/beans.xml" Watch "Glassfish/NetBeans/beans.xml" New topic


Roy Pozarelli
Ranch Hand

Joined: Oct 17, 2009
Posts: 45
My beans.xml file was auto-generated by NetBeans IDE 7.0.1 listed below:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

When I start Glassfish Server 3.1 I get an error that I don't understand (see below):

WARNING: Error handling beans.xml at META-INF/beans.xml Illegal character in path at index 27: file:/C:/Users/Roy/Java/Beg EJB 3/CH7/dist/gfdeploy/CH7/CH7-ejb_jar/META-INF/beans.xml
at org.glassfish.weld.BeanDeploymentArchiveImpl.handleEntry(
at org.glassfish.weld.BeanDeploymentArchiveImpl.collectJarInfo(
at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(
at org.glassfish.weld.DeploymentImpl.<init>(
at org.glassfish.weld.WeldDeployer.load(
at org.glassfish.weld.WeldDeployer.load(
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(
at com.sun.hk2.component.AbstractCreatorImpl.inject(
at com.sun.hk2.component.ConstructorCreator.initialize(
at com.sun.hk2.component.AbstractCreatorImpl.get(
at com.sun.hk2.component.SingletonInhabitant.get(
at com.sun.hk2.component.EventPublishingInhabitant.get(
at com.sun.hk2.component.AbstractInhabitantImpl.get(
at com.sun.enterprise.v3.server.AppServerStartup.doStart(
at com.sun.enterprise.v3.server.AppServerStartup.start(
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(

Now the only indication is at index 27, but in looking at the beans.xml file I don't see what the problem is. In reading through the forums, it indicates that the server only looks to see if the beans.xml file exists, so I gutted it with only the first line left in the file and the error disappears.
1. Why?
2. Is that a problem that will crop up down the line?
3. Can the "real" problem be solved - if so, how? What do I need to modify in beans.xml to make Glassfish happy?
4. Is there a "bug-fix" to NetBeans IDE 7.0.1 that "resolves" the generation of beans.xml when it is auto-generated?

OCP Java SE 6 Programmer,
OCM Java SE 6 Developer
OCE Web Components (OCEWD)
OCE Web Services (OCEWSD)
MySQL Certified Administrator & Developer,
OMG Certified UML Prof. Fund., Int., Adv.
Karthik Shiraly

Joined: Apr 04, 2009
Posts: 874
  15 Illegal character in path at index 27: file:/C:/Users/Roy/Java/Beg EJB 3/CH7/dist/gfdeploy/CH7/CH7-ejb_jar/META-INF/beans.xml

It's not referring to 27th character inside beans.xml. It's actually referring to the 27th character in the URL "file:/C:/Users/Roy/Java/Beg EJB 3/CH7/dist/gfdeploy/CH7/CH7-ejb_jar/META-INF/beans.xml".
I'm guessing that the spaces in the subdirectory "Beg EJB 3" is the problem. Use a path that does not contain spaces. That Glassfish deployment component should have correctly escaped spaces in the URL, but looks like it doesn't.
Roy Pozarelli
Ranch Hand

Joined: Oct 17, 2009
Posts: 45
Thanks, that was it. It's always nice to have the right fix.
I agree. Here's the link:
subject: Glassfish/NetBeans/beans.xml
It's not a secret anymore!