I want to use javax jms - netbeans

I want to use javax.jms in netbeans project , but netbeans tell my that there is no package like this , what should I do ?
this error occurs when I try from terminal
Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/MessageListener

You have to have the jms-api.jar in your classpath. I got mine from HornetQ.
Edit
I just saw that you said you were using NetBeans. In that case, you need to have downloaded the version of NetBeans that includes Java EE. Go here and download that. This site seems to have a nice tutorial on how to set it up from there.

Related

Eclipse: Can not find the tag library descriptor for "http://java.sun.com/jsf/core" using JBoss

I know this question was asked a lot of times, since I searched for hours for a solution, but it was never answered (or at least not for my situation).
I am using Wildfly 8.0 (ex JBoss), so I understand that I do not need to add jstl jars nor JSF jars since the implementation is already shipped with JBoss.
Now even when telling eclipse to use the Wildfly runtime libraries, I get the above error. I checked and the jboss-jstl-api_1.2_spec-1.0.4.Final.jar is part of the library
How can I get through this? I tried putting downloading jstl jars (from https://jstl.java.net/) and putting them in the lib directory but it is not working.
Copying the jars into "lib" works perfectly when I use Tomcat which doesn't have its jstl implementation. But not with Wildfly (maybe because eclipse ignores the jars I put in the lib directory since Wildfly has its own jars? But then why do I get the error in the first place? I am confused).
Thanks to anyone who could help me with this.
Edit: I forgot to precise that even with these errors on all my JSPs, the project builds and works perfectly on the server.
These errors are eclipse specific, it does not recognize the taglibs and displays annoying error messages at taglib declarations and warnings when using these (unknown to eclipse) tags. Plus, I can't use code completion.
Edit: I bypassed the problem, for the moment, by adding standalone myfaces and jstl libraries to the build path. I would like though that eclipse uses the jars available on server side. (For JPA for example I did not need to add the hibernate library to the build path, I simply told eclipse that the JPA implementation si available on server runtime and it worked fine with code completion and everything).
Alright, to not have to add any additional libraries (that are not needed by the server) here's what I had to do in addition to adding the Wildfly runtime library to the project:
Go to Project/Properties/Project Facets/Java Server Faces and chose Library Provided by Target Runtime in the library type (instead of a User Library).
I'm truly disappointed JSF support in eclipse. I'm encountering such caveats all the time.
I'm using JBoss 7.1.1 and even adding JBoss as the Target Runtime of the project didn't help.
The only solution that worked for me, was to define new JSF library inside Eclipse: Window Preferences -> Java -> Build Path -> User Libraries -> click New (pointing to the jsf-impl.jar and jsf-api.jar). And then adding such library to the build path of the project.
It solved all annoying eclipse errors can not find tag library. So it is pretty similar to the #Riccatti first solution.
Btw: answer which I found on the eclipse forum says that this error is usually caused by not existing JSF tag libraries (that are present in jsf-impl.jar) on the classpath.

eclipse error about builing project archive

I am trying to setup an empty project by maven for using WELD CDI and JSF. Every thing was OK until I have a strange error message from eclipse when I am trying to clean and rebuild:
I have no idea which file it is trying to locate. is it web.xml or any other descriptor file?
any body knows how I can fix this problem?
The source of the problem was jboss tools plugin, I don't know why.
My problem is solved by removing Jboss tools plugin from my eclipse Juno.

Eclipse Indigo and m2e and wsimport goal. how to generate ws files in this year 2012

Am part of a team building a jsp/j2ee webapp. I decided to use STS 2.9.2 based on eclipse Indigo as opposed to every other person in the group as they all use netbeans .Every thing was perfect until we reach a stage where one of us was responsible to create some webservices in a maven module which is not a webapp module itself. At that point I was unable to run the webapp. it throws this error:
com.sun.xml.ws.transport.http.servlet.WSServletContextListener parseAdaptersAndCreateDelegate SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.Error: Unresolved compilation problems: The import org.tempuri cannot be resolved
From what I was read from googling either I add additional configuration to the pom or set eclipse to ignore the goal. The first option is out because I really don't want to edit the pom because it's not relevant to the team and to the overall project.I am not really sure about the second option.
But essentially the question is how you solve this issue? For the meantime i switched back to netbeans and it seems to be cool but i want to use eclipse

eclipse: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EObject driving me bananas?

Hell folks, i have eclipse Version: Helios Service Release 1 Build id: 20100917-0705.
Does someone know how to get rid of this nasty exception?
I've tried with a brand new indigo installation, brand new tomcat 7.0.22, to no avail, what could be wrong with my project?
I'm using geotools.
Ok, I somewhat found the cause. When I use Geotools' DataStoreFinder.getDataStore() method the exception shows up. if I use other methods everything's fine.
What puzzles me, and the main reason to ask this question here, is because one would expect other kind of exception, like a geotools exception, but, why an eclipse exception? however, if someone finds ever the reason, I'll be more than glad to listen about it.
if you want to replicate it, these are the steps to follow:
download geotools (exception 'works' with vers 2.7 and 8)
eclipse indigo or helios
apache tomcat 6 or 7
jdk 1.6
create a simple servlet and just call DataStoreFinder.getDataStore() inside the doget or dopost method.
Just a guess, but sounds like you don't have EMF installed and Geotools must depend on it. EObject is the EMF base class. If you used p2 to install Geotools though, it should have made sure that EMF was already installed. If however you just copied the plugins for it into your Eclipse installation and did not have EMF, you would see this.

JBoss Seam Project errors

I have a JBoss Seam project that a coworker created about a year ago. I'm taking over it now and it needs some work done. So I'm trying to setup the project in Eclipse Indigo. Here is the list of things I have installed so far:
JBoss 4.2.2 GA
JBoss Seam 2.2.0 GA
Glassfish v2.1
JBoss Seam Tools Plugin for Eclipse Indigo
For some reason I am not able to build the project to get an ear for JBoss. The errors I have are one in glassfish-builld.xml which says "Target clean does not exist in this project." And then I have errors in a bunch of generic.jsp file (I have no idea what their purpose is). The error for those is that a library for JBoss Seam called org.jboss.seam.wiki.util.WikiUtil cannot be found.
Can someone point me in the right direction to get this setup and running on JBoss?
Also org.jboss.seam.wiki.util.WikiUtil is a class that is a part of... Seam example project that is added to JBoss Seam distribution in examples/wiki directory. So if you really need it you will be able to find it there. But honestly I don't see any reason to put any dependency to Seam examples in project. Consider just deleting / commening out the code that refers to this class becasue it is probably some quick and dirty test code.
Do you want to run it on Glassfish or Jboss?
Did you import an entire eclipse project or create a new one?
I would first check the referenced libraries to see if there's anything missing(Libraries under Java Build Path for Helios, not sure if that differs from Indigo). Add a -verbose tag to the build and check out the output.