wood burning stoves 2.0*
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
Author

Glassfish/NetBeans/beans.xml

Roy Pozarelli
Ranch Hand

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

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>

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
java.net.URISyntaxException: 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 java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3066)
at java.net.URI$Parser.parse(URI.java:3014)
at java.net.URI.<init>(URI.java:578)
at java.net.URL.toURI(URL.java:918)
at org.glassfish.weld.BeanDeploymentArchiveImpl.handleEntry(BeanDeploymentArchiveImpl.java:504)
at org.glassfish.weld.BeanDeploymentArchiveImpl.collectJarInfo(BeanDeploymentArchiveImpl.java:482)
at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:422)
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:148)
at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:128)
at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:120)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:372)
at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:99)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:257)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

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
OCE JPA 6
OCE EJB 6
MySQL Certified Administrator & Developer,
OMG Certified UML Prof. Fund., Int., Adv.
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 475
    
    3
java.net.URISyntaxException: 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: 39
Thanks, that was it. It's always nice to have the right fix.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Glassfish/NetBeans/beans.xml
 
Similar Threads
Netbeans 6.8M1 and JAX-RS using Jersey problems
How to develop a standalone swing application with ejb 3.1
Accessing EJB from a Swing Client
could not redeploy web application with libraries - Error in linking security policy
getting error when deploying web app in weblogic 10.0