This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218317 - Netbeans not detecting tlds included to post compile tag libs
Summary: Netbeans not detecting tlds included to post compile tag libs
Status: RESOLVED INCOMPLETE
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 20:09 UTC by dnordahl1
Modified: 2012-10-11 12:52 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (53.56 KB, text/plain)
2012-09-14 13:53 UTC, dnordahl1
Details
Output log (4.77 KB, text/plain)
2012-09-14 13:55 UTC, dnordahl1
Details
Project properties (9.74 KB, application/octet-stream)
2012-09-17 13:33 UTC, dnordahl1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dnordahl1 2012-09-13 20:09:53 UTC
I've generated JSFs from entity beans from my schema.  Trying to build my app which is targeted deployment on Apache/OpenEJB I get the error: 

The line in welcomeJSF.jsf: 

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>

Will not compile due to the error: 

org.apache.jasper.JasperException: .... web/welcomeJSF.jsp(3,55) PWC6188: The absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml or the jar files deployed with this application

However my project library contains myfaces-impl-2.1.8.jar as well as my and this library I also have placed in the jsp-compilation folder.  This jar contains all the tlds necessary to compile the jsf tags.  

I have been combing forums for days for anyone that has solved this issue to no avail.  If I cannot compile my project, I will be forced to switch IDEs.  I at least need a work around for this issue.
Comment 1 Martin Fousek 2012-09-14 06:17:37 UTC
Sorry, but it's quite complicated to understand to your issue. You are writing about welcomeJSF.jsf but then you use jsp syntax and paste exception with .jsp file. So I will expect, that you are using JSF library in the JSP pages, right?

I gave it try for an hour and I have to say that I wasn't even able to make Tomcat+OpenEJB+MyFaces working together since the OpenEJB didn't work properly with myfaces and thrown several exceptions related to this combination. It would correspond to OpenEJB-TomEE comparsion table:
http://tomee.apache.org/comparison.html

I would understand that that for installation MyFaces would be probably required more steps than just simply copy JAR files on classpaths (at least I saw some web.xml configuration). So if you have any documentation how to do that, please provide it here, thanks.

Shortly, to be able to reproduce your issue I would need steps how did you installed your server environment (all three parts) since there are many combination of similar builds, configurations (especially tomcat+openejb) and unknown way to me to install also myfaces into such bundle.

Also please provide your NetBeans messages log and output from out server (one of it you can copy from console by running the application, the second you can get using http://wiki.netbeans.org/FaqLogMessagesFile).
Comment 2 dnordahl1 2012-09-14 13:53:42 UTC
Created attachment 124372 [details]
messages.log
Comment 3 dnordahl1 2012-09-14 13:55:58 UTC
Created attachment 124374 [details]
Output log
Comment 4 dnordahl1 2012-09-14 14:02:48 UTC
I apologize for the ambiguities and errors in the information below.  I am actually trying to deploy to TomEE and it is the welcomeJSF.jsp page which is created through the netbeans 'create jsf from entity classes' option.  

I installed the SNAPSHOT of TomEE and in Netbeans defining a location of Apache Tomcat and pointing it to my TomEE directory.  But this has left the issue of whenever I go to create entity classes, it insists my server does not support them so I must switch to glass fish, then switch back after the classes are created. I think this issue probably occurs when it comes to generating the JSF's from entity classes as well.  

In the output log attached, the line referring to in build-impl.xml is:

<java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">

Thank you so much for looking at this.  It has taken a very long time to figure out how to get the EJBs to deploy, so hitting another wall here has been frustrating.
Comment 5 Martin Fousek 2012-09-17 04:46:46 UTC
Ok, thanks for attaching requested information although there doesn't seem to be generally anything wrong - the JSPs just don't compile (due to not found tld's). 

Anyway, sorry but I have to downgrade priority of your issue since you are trying that and facing troubles due to unsupported application server. I don't say that I will not try to figure out how it could be workarounded or fixed, just the P1 is not appropriate here at all.

I'll try to take a look on that today and will you keep informed.
Comment 6 Martin Fousek 2012-09-17 06:33:45 UTC
> I installed the SNAPSHOT of TomEE and in Netbeans defining a location of Apache
> Tomcat and pointing it to my TomEE directory.  But this has left the issue of
> whenever I go to create entity classes, it insists my server does not support
> them so I must switch to glass fish, then switch back after the classes are
> created. I think this issue probably occurs when it comes to generating the
> JSF's from entity classes as well.  

I tried to reproduce your case but I'm not able to reproduce your issue. My steps were:
1, installed TomEE server from http://www.apache.org/dyn/closer.cgi/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.tar.gz
2, Created new web project with GF
3, generated entity classes and JSPs for some DataSource
4, project switched to the TomEE server
-> tag libraries are found - I would expect in embedded myfaces JARs

> In the output log attached, the line referring to in build-impl.xml is:
> <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true"
> fork="true">

Yeah, that means that the build fails during the jsps compilation.

Could you attach your project.properties file? Or the best would be if you could attach whole project and I could try to debug it what's wrong but I know that it's not always possible. Please could you retry that also with the TomEE bundle, I mentioned above?

Thanks.
Comment 7 dnordahl1 2012-09-17 13:33:43 UTC
Created attachment 124454 [details]
Project properties
Comment 8 dnordahl1 2012-09-17 13:34:22 UTC
Thank you for looking at this.. I attached the project properties file.
Comment 9 dnordahl1 2012-09-17 16:27:48 UTC
To recreate, you might try removing any jars containing tlds such as jsf-impl.jar from all project files.  Initially I think I ended up with problems from Netbeans choosing the Sun RI implementation of faces at deployment.  Or maybe I just hosed my project up at some point.  

But I finally got a work around by just extracting the tlds from the myfaces jars and specifically entering 

<%@taglib uri="/META-INF/myfaces_core.tld" prefix="f" %>
<%@taglib uri="/META-INF/myfaces_html.tld" prefix="h" %>

at the top of my faces JSP pages (which I'm sure is probably not best practice).  

Before this I also tried the adding the following to my web.xml:  

<taglib>
  <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
  <taglib-location>/META-INF/myfaces_core.tld</taglib-location>
</taglib>
<taglib>
  <taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
  <taglib-location>/META-INF/myfaces_html.tld</taglib-location>
</taglib>

For this reason it seems that independent of the app server, the compile error and message returned were incorrect: "The
absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml
or the jar files deployed with this application"

Because I tried defining the URI in both the classpath and the web.xml, and both definitions were ignored.
Comment 10 Martin Fousek 2012-09-18 08:51:20 UTC
(In reply to comment #8)
> Thank you for looking at this.. I attached the project properties file.

Thanks for the file. BTW, the paths in web.xml are not necessary probably since JSP 2.0. Anyway I compared my working properties with your ones and I have few suggestions you could try out.

BTW, between every attempt it's necessary to do any change (even only space) in the JSP page and save it.

1, Could you try out to have full absolute path at least to myfaces JARs? Means these two lines rewrite to absolute paths:
file.reference.myfaces-api-2.1.8.jar=lib/myfaces-api-2.1.8.jar
file.reference.myfaces-impl-2.1.8.jar=lib/myfaces-impl-2.1.8.jar

2, I don't know classpaths of your MyFaces library. Anyway you shouldn't duplicate MyFaces jars on the javac.classpaths. So then try to remove this line:
${libs.MyFaces.classpath}

3, Please check that you have in your myfaces (probably impl) .jar in META-INF package myfaces_core.tld and myfaces_html.tld.

I tried these two cases... New project with JSP on TomEE - worked well, New project with JSP on Apache + MyFaces jars on project classpath - worked well again. So it's really strange to me that it doesn't work to you.

Ok, please try out mentioned steps with the changes in JSP file and save and let me know, thanks...
Comment 11 Martin Fousek 2012-10-11 12:52:10 UTC
Waiting for the user response. Reported please could you attach described information and reopen the issue then? Thanks a lot...