Weld not initializing properly

前端 未结 4 1289
名媛妹妹
名媛妹妹 2021-01-12 03:42

I am setting up basic environment for learning CDI in JavaEE7. I have the following code for starting Weld. Just a startup and shutdown.

package         


        
4条回答
  •  生来不讨喜
    2021-01-12 03:58

    Your setup is ok for learning CDI in Java SE.

    For using CDI in Java EE, you obviously need a Java EE Container, a plain old application with a main method won't do.

    Weld is simply telling you that transactions are not available (since you're not running in an EE container), so any transaction-related CDI features will be disabled.

    Dependency injection will work in your case, as long as you don't try to inject any Java EE objects or use any CDI features that require a Java EE container.

提交回复
热议问题