What is Weld, JSR-299?

What does Weld do/give you? Weld is the reference implementation of the abstract JSR-299 API, which is better known as CDI, Contexts and Dependency Injection, an API which is provided through javax.enterprise.context and javax.enterprise.inject packages. How does it relate to Java EE 6? JSR-299 is part of Java EE 6 (JSR-316). How would one use … Read more

Maven Eclipse Debug “JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)”

To kill a process listening on a port: This command should list processes listening on all ports: netstat -ano The -o option will display the process id. If you’re using a *nix system, you can refine a little further with: netstat -ano | grep <badport> When you have the process id, you can terminate it … Read more

Inject list of objects in CDI (Weld)

Combining my attempts with an answer from the Weld forum: @Inject @Any private Instance<SocialNetworkService> services; Instance implements Iterable, so it is then possible to simply use the for-each loop. The @Any qualifier is needed. Another way to do this is by using the event system: create a MessageEvent (containing all the information about the message) … Read more

Are @ManagedBeans obsolete in JavaEE6 because of @Named in CDI/Weld?

In short, @ManagedBean makes sense for applications that use JSF but do not use JSR 299 (whatever the reason is). Below a longer explanation from Gavin King: Re: Comparisons to @ManagedBean annotations in JSF2?: While looking through the Weld examples, and the older WebBeans documentation, it looks like a competitor to the new @ManagedBean JSF … Read more

CDI: beans.xml, where do I put you?

For EJB and JAR packaging you should place the beans.xml in src/main/resources/META-INF/. For WAR packaging you should place the beans.xml in src/main/webapp/WEB-INF/. Remember that only .java files should be put in the src/main/java and src/test/java directories. Resources like .xml files should be in src/main/resources.

techhipbettruvabetnorabahisbahis forumu