Tuesday, December 12, 2006

According to TLD or attribute directive in tag file, attribute value does not accept any expressions

Compile JSP tomcat JSTL error "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"

Compile error from tomcat when it encounters a JSP: "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"

For some reason the JSP is using the 1.2 JSP (and 1.0 JSTL) and EL expressions aren't understood. There's a lot of hits on the web for this but in summary there are 2 important things to do to ensure you're getting the right version of the spec:
  1. Reference the correct servlet specification in your deployment descriptor:
    <?xml version="1.0"?>
    <web-app version="2.4"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  2. Reference the correct JSTL uri in your JSP:
    <%@ taglib uri='http://java.sun.com/jstl/core' prefix='c'%>

    <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>


What Specification goes with what?
Web-app(deployment schema)
JSTL(core uri reference)
WebSphere5.x6.x7.x (?)

Friday, December 08, 2006

WebSphere DTMConfigurationException: No default implementation found

WebSphere DTMConfigurationException DTMManager xalan

Problem:After upgrading the WebSphere Application Server JDK with the .11 Fix pack (making it there is the following error when my web app. tries to get a transformer:
org.apache.xml.dtm.DTMConfigurationException: No default implementation found
    at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:177)
    at org.apache.xpath.XPathContext.(XPathContext.java:125)
    at org.apache.xalan.transformer.TransformerImpl.(TransformerImpl.java:398)
    at org.apache.xalan.templates.StylesheetRoot.newTransformer(StylesheetRoot.java:197)

The problem seems to be at least associated with the fix pack creating a new file "xalan.properties" in APPSERVER_HOME\java\jre\lib. It could also be upgrading the xalan libraries as well (in xml.jar).

Edit this file - you'll notice this isn't defining any properties, everything is commented out - and add the property:

Alternatively, remove or rename this file and the problem should also go away.

Alternatively again, add the JVM system property "org.apache.xml.dtm.DTMManager". You can do this on WebSphere by going to:
Application servers > server1 > Process Definition > Java Virtual Machine
... and adding to the Generic JVM arguments:

Restart the server and the problem should also go away - use this approach for where you don't have access to the APPSERVER_HOME\java\jre\lib files and can only configure your application's JVM.