resource-ref: has no valid JNDI binding, which means resource-ref defined in the deployment descripter has no valid binding. Assume that you have configured JDBC Data Resources (JNDI) in Jboss 4.0 for any database (Db2 , Postgres, etc ..) . That is you have defined a reference lookup name (eg. jdbc/techLabsDS) to an external resource in the WEB-INF\web.xml and also you have created / copied *-ds.xml descriptor file with neccessary configurations like jndi-name , driver class in the in the Jboss application server folder Drive:\jboss-4.0.0\server\default\deploy . To use the resource adaptor defined in the deployment descripter (web.xml) , it must be integrated into the JBoss application server using a ds.xml descriptor file .
Now when you start the Jboss server or when you try to run the application for accessing the database , you may get the error "javax.naming.NamingException: resource-ref: jdbc/techLabsDS has no valid JNDI binding. Check the jboss-web/resource-ref" where techLabsDS is the JNDI name. To solve the this error , you have to copy the jboss-web.xml file with the following additional lines to Application's WEB-INF folder.
<resource-ref>
<res-ref-name>jdbc/techLabsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/jdbc/techLabsDS</resource-ref>
The following picture shows where the jboss-web.xml file to be copied.
Error : resource-ref: has no valid JNDI binding. Check the jboss-web/resource-ref - Solution
Solution for Unable to find a javac compiler error in Jboss 4.0 with Eclipse when running JSP file
When you run a JSP with JBoss Application server in eclipse IDE , the following error may occur "org.apache.jasper.JasperException: Unable to compile class for JSP"
JBoss appserver throws the following error
Unable to find a javac compiler , com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK
The reason for the above error is "com.sun.tools.javac.Main" class which is bundled with tools.jar, is not in the class path . So we need to include the tools.jar file in the class path. When we add the jre to the build path , it includes all necessary jar files except tools.jar in the class path . Assume that jdk1.6.0_23 is installed in d:\ . jdk1.6.0_23 can be downloaded from java site.
tools.jar file will be located in the installed folder of jdk (i.e d:\jdk1.6.0_23\lib OR d:\ jdk1.6.0_23\jre\lib)
Steps to include the tools.jar file in the classpath in eclipse
1. Select Windows->Preferences ->Java -> Installed JRE
2. Highlight the selected jre and click in edit buttor as shown in the following screen shot
3. Click on Add External Jars and select the tools.jar file from the jdk\lib OR jdk\jre\lib folder then Finish.
Now you will be able to run the JSP file.