Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when deploying using CDI on Glassfish

Tags:

glassfish

cdi

I was playing around with CDI on Glassfish but did not get too far. As soon as I put an empyt beans.xml in /WebContent/META-INF I get the following error:

cannot Deploy CDI_Example Deployment Error for module: CDI_Example: Exception while loading the app : org.glassfish.deployment.common.DeploymentException: WELD-001201 Error loading beans.xml URL: null

The Weld documentation says the file may be empty but it looks like Glassfish v3 expects anything within the file.

Anybody got an idea?

Thx

like image 678
darkspirit Avatar asked Mar 03 '26 11:03

darkspirit


1 Answers

"Empty" does not mean that beans.xml should be completely empty. It means that you don't have to specify anything, but it should at least contain the following content:

<?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>
like image 82
Wolkenarchitekt Avatar answered Mar 05 '26 08:03

Wolkenarchitekt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!