2

I created the following projects in OEPE:

  • weld001408 (Java EE - Enterprise Application Project)
  • weld001408utility (Java EE - Uitility Project), belongs to the ear weld001408
  • weld001408web (Web - Dynamic Web Project), belongs to the ear weld001408

When I created the project, I didn't change the defaults (onley ear-membership) and the target-runtime is Oracle WebLogic Server 12.1.1. And the clean domain, created with the wizard, is added to the workspace.

The Code is the following:

utility-project

class 'weld001408utility/ValueProducer.java'

package weld001408utility;

import javax.enterprise.inject.Produces;

public class ValueProducer {

    @Produces
    public String stringValue() {
        return "someStringValue";
    }

}

META-INF/beans.xml

<?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>

web-project

weld001408web/ValueConsumerServlet.java

package weld001408web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.inject.Inject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ValueConsumerServlet
 */
@WebServlet("/ValueConsumerServlet")
public class ValueConsumerServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    @Inject
    private String injectedValue;

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        PrintWriter pw = response.getWriter();
        pw.write("injectedValue: " + injectedValue);
        pw.flush();

    }

}

WEB-INF/beans.xml

<?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>

The issue

Now when I try to deploy the application in Eclipse, I get always a WELD-001408 error:

<01.03.2013 10:07 Uhr MEZ> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.management.DeploymentException: 
    at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:123)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:239)
    at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
    Truncated. see log file for complete stacktrace
Caused By: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [String] with qualifiers [@Default] at injection point [[field] @Inject private weld001408web.ValueConsumerServlet.injectedValue]
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:258)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:105)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:125)
    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:324)
    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:309)
    Truncated. see log file for complete stacktrace
> 

But when I export the ear from eclipse and deploy that file over the weblogic administration console, then everything's working fine and the value is correctly injected to the servlet. No problems on deployment, nothing.

There are some patches for weblogic around and I have the latest installed (I checked a lot bugs which could belongs to my problem, and they should all included with 12.1.1.0.2):

WebLogic Server 12.1.1.0.2 PSU Patch for BUG14331523 Thu Oct 11 15:08:09 IST 2012
WebLogic Server 12.1.1.0  Wed Dec 7 08:40:57 PST 2011 1445491 >

I tried the same application on Windows Vista and on a Linux based System with the latest OEPE Versions (all-in-one package), no success...

The question

Has somone the exact same issue? Is it possible for someone to reproduce the problem? And when not, on which configuration with what patches is it working?

I don't know if it's a Oracle Enterprise Pack for Eclipse or an WebLogic-Issue.

Thanks for helping!

4

1 回答 1

1

我解决了如下所述的问题。添加图片以使其更容易。

转到 Eclipse Servers (View),右键单击 weblogic server 12.1.3 并单击属性。

在此处输入图像描述

在 Weblogic --> Publishing 中,选择“Publish as an exploded archive”

在此处输入图像描述

于 2015-09-21T14:22:39.137 回答