My problem is, that when the <c:if tag is reached the following problem occurs.
I am using Spring on google app engine.
java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:620)
at javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:354)
at org.apache.jsp.WEB_002dINF.views.templates.master_005fb_jsp._jspx_meth_c_forEach_0(master_005fb_jsp.java:544)
at org.apache.jsp.WEB_002dINF.views.templates.master_005fb_jsp._jspx_meth_c_if_0(master_005fb_jsp.java:482)
at org.apache.jsp.WEB_002dINF.views.templates.master_005fb_jsp._jspService(master_005fb_jsp.java:314)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
The java.lang.AbstractMethodError means that an abstract method as mentioned in the error message which is declared in some (abstract) API in the current runtime classpath is missing in the concrete implementation in the current runtime classpath.
In this case it's the javax.servlet.jsp.PageContext.getELContext() method. As per the javadocs this abstract method was introduced in JSP 2.1. The concrete implementation is the server you're currently using.
This can be caused by having a jsp-api.jar of a different server make/version supporting JSP 2.1 in the runtime classpath of your webapp, most likely in /WEB-INF/lib folder, while the GAE server you're using doesn't implement JSP 2.1. Get rid of all server-specific libraries in the runtime classpath of your webapp. They doesn't belong there. They belongs (and are already) in the server's library.
Try using an older version of JSTL. It looks like you're using 1.2 and you should probably be using 1.1.
Most probably a library version issues. Google AppEngine provides a default JSTL library and you don't have to include your own on the WEB-INF/lib directory. Just remove the library you might have added to that directory and clean build to test again.
you donĀ“t have to add any jstl library to web-inf/lib directory, just run
Related
I am trying to generate java classes from xsd. I added to my library the following two files: com.sun.xml.bind_2.2.0.v201004141950.jar and com.sun.tools.xjc_2.2.0.jar, but it still gives me an error
Exception in thread "main" java.lang.ClassNotFoundException: There's no JAXB 2.2 API in the classpath
at com.sun.tools.xjc.ClassLoaderBuilder.createProtectiveClassLoader(ClassLoaderBuilder.java:82)
at com.sun.tools.xjc.XJCFacade.main(XJCFacade.java:65)
What can be the problem? When I created the project I chose JAXB 2.1 with jre target runtime. What do I need to include to make it run?
Not sure I understand any of this. The JAXB Reference Implementation ("RI") has been included with the JDK since Java 6.
https://jaxb.java.net/guide/Which_JAXB_RI_is_included_in_which_JDK_.html
So, given this, why do you need to add any external libraries ?
Make sure to include the jaxb-impl.jar library in your project. You can download one for example from here: http://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.2.4/jaxb-impl-2.2.4.jar
If you're using Maven, you can include this as a dependency, otherwise download the file and add it as a library in your project.
If you need a different version of the library, move up one directory in the link that I added above, you can find other versions there as well.
If you want to automate the class generation, since you're changing the schema on a regular basis, you should automate the process, e.g through Maven.
I have a strange problem. I get an error from Google Web Toolkit stating the following:
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract
com.pluspopularity.model.LinkItem com.pluspopularity.web.client.GreetingService.greetServer(java.lang.String)
throws java.lang.IllegalArgumentException' threw an unexpected exception:
java.lang.NoClassDefFoundError: org/json/JSONException
Now, I can find lots of questions about this java.lang.NoClassDefFoundError: org/json/JSONException exception, but they all seem to be fixed by GWT version 2.5 because org.json was since then included in the gwt-dev.jar package.
I have version 2.5 and I can see org.json in my GWT SDK library.
So I have no idea where this error comes from.
Something I noticed: the GWT SDK folder contains a lot of jar files, but only 4 are included when I add it as an SDK in Eclipse: gwt-user.jar, gwt-dev.jar, validation-api-1.0.0.GA-sources.jar and validation-api-1.0.0.GA.jar. In some issues in questions about this error from GWT versions before 2.5 I see mentions of a gwt-servlet-deps.jar file. That file sits inside my GWT SDK folder, but it's not included in the SDK library in Eclipse.
I re-installed the GWT SDK via Eclipse but still only those 4 files are included.
You get an error at runtime (apparently), on the server-side.
If the Eclipse plugin doesn't do it for you (I have no idea if it's supposed to do it or not), you should go get gwt-servlet-deps.jar (or any JAR that contains org.json) and copy it to your WEB-INF/lib next to gwt-servlet.jar.
org.json.JSONException is present in json-20090211.jar.
Both gwt-user and request-factory-server have dependency on it. In a maven set up it gets copied automatically via request-factory for us since both are in runtime scope.
In my project, I'm using both glassfish-embedded 3.1.1 and the guava lib... The problem is that glassfish comes with the old implementation of guava (ie google-collections)...
This results in NoSuchMethodError at runtime, for example when using Lists.reverse(), or Sets.newIdentityHashSet() which were introduced later in guava.
I don't find any solution to solve this... (the only one is to manually trash the com/google classes directory in the glassfish jar...)
You can overcome this be specifying the below. Read the Delegation section of the Class Loaders chapter.
<class-loader delegate="false" />
Check this SO post for class loading in Java EE apps in general: Java EE class loading standard
Glassfish should never have included com.google classes in their own jar. That was an error.
UPDATE[#sly7_7]: It seems like glassfish does not include guava in their own jar anymore, but it depends on the guava artifact instead. This should resolve the problem.
Thanks to #JagWire for pointing this.
I was able to make the error go away by using the following Glassfish v4 build:
http://grepcode.com/snapshot/maven.java.net/content/groups/promoted/org.glassfish.main.extras/glassfish-embedded-all/4.0.1-b01
Might be worth taking a look.
I am new to Java and experiencing problems understanding exceptions thrown by the framework.
Right now, I am trying to implement a regular expression validator into an application consisting of Java 5 EE with myFaces 1.2 and Tobago running in an apache tomcat 5.5.
I followed a couple of tutorials (including the Java 5 EE tut from SUN) and came pretty far. However, when calling my jsp, I get the following error message:
java.lang.LinkageError: loader constraints violated when linking javax/faces/validator/Validator class
Can anyone explain to me what I need to do to solve this problem?
So far, it seems as if MyFaces 1.1.7 has a version conflict to TomCat 5.5. Both contain javax.* packages (one of them namely javax.faces.validator). The validator class has a different version in the packages. The corresponding MyFaces library is called myfaces-api-1.1.7.jar and the TomCat library is called javaee.jar.
The included javax packages in the myfaces lib is a subset of the packages from within the javaee lib. However... I cannot skip any of both, because the project will fail to start then.
Any tipps?
This is almost certainly caused by your application having its own copy of Validator (in one of its JAR files), and this is clashing with the server's own copy. Something this can cause a LinkageError.
Find out which of your WAR or EAR's JAR files contains that, and remove it (along with the rest of the javax.faces classes).
Sounds like a classpath problem. Check your classpath for two jars with conflicting versions (both containing the javax.faces.validator.Validator class)
According to the MyFaces homepage. Tomcat Config: Tomcat 5.5.x
Some users have reported problems when
using MyFaces with Tomcat 5.5.x. Here
is a short guide that will hopefully
help you not run into the same
problems :-)
If your are using the binary version
of MyFaces: MyFaces is packaged so
that it works with Tomcat 5.0.x so
the WEB-INF/lib/jsp-2.0.jar and
WEB-INF/lib/commons-el.jar JAR files must be removed from your
WAR files (including the examples).
If you are building from source: If
you want to build MyFaces from scratch
to work with Tomcat 5.5.x, you have to
set the property
tomcat.pre.5.5.version in the
$MYFACES_HOME/build/build.default.properties
file to the value false.
Perhaps you've got two conflicting versions of the same library available on your classpath. For example, you might have a jar file in WEB-INF/lib that's already provided in TOMCAT_HOME/lib. (el-api.jar is a common culprit, but there are other possibilities.)
Have a Spring 2.5 webapp which runs fine under 1.6, but under 1.5 it can't find PostConstruct class.
Found the following which suggests I need common-annotations.jar (JSR-250) but cannot find anywhere to download it
The reference implementation is available here:
http://jcp.org/aboutJava/communityprocess/final/jsr250/index.html
Reference Implementation (RI) and Technology Compatibility Kit is part of glassfish.
In other words, you might end up having to download the GlassFish Application Server just to get the single jar file.