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 246168 - JSF autocomplete stop working when HTML5 file is used
Summary: JSF autocomplete stop working when HTML5 file is used
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-31 14:31 UTC by arthurgregorio
Modified: 2016-07-07 09:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log do IDE (182.44 KB, text/plain)
2014-07-31 14:31 UTC, arthurgregorio
Details
page (5.69 KB, text/xhtml)
2014-07-31 14:55 UTC, arthurgregorio
Details
the message (181.45 KB, image/png)
2014-07-31 14:56 UTC, arthurgregorio
Details
my pom (8.94 KB, application/xml)
2014-08-04 12:29 UTC, arthurgregorio
Details
the diff from old pom (4.07 KB, application/xml)
2014-08-08 13:22 UTC, arthurgregorio
Details
screenshot from the project view (204.72 KB, image/png)
2014-08-15 08:02 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arthurgregorio 2014-07-31 14:31:04 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Linux version 3.2.0-4-amd64 running on amd64
Java; VM; Vendor = 1.8.0_11
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.11-b03

when i try to edit my jsf files (*.xhtml) the IDE html checker say that cannot "find preset schema for namespace http //java.sun.com/jsf/facelets" and disable the autocomplete for my jsf tags..
Comment 1 arthurgregorio 2014-07-31 14:31:08 UTC
Created attachment 148446 [details]
Log do IDE
Comment 2 Martin Fousek 2014-07-31 14:46:27 UTC
Please could you attach sample .xhtml page where it doesn't work to you?
Comment 3 arthurgregorio 2014-07-31 14:55:33 UTC
Created attachment 148447 [details]
page

this is the page from the printscreen, but in thw whole project JSF autocomplete is disabled... i only see completion for angular and knockout
Comment 4 arthurgregorio 2014-07-31 14:56:28 UTC
Created attachment 148448 [details]
the message

the image of the page in my IDE with the message
Comment 5 arthurgregorio 2014-07-31 15:01:15 UTC
one more tip, when i close and reopen IDE many times, the problem seems to stop but when i close the xhtml and reopen, or open another xhtml, the problem is back...

i develop in JSF 2.1 in the same IDE, same machine, this problem does not happen... its only in JSF 2.2 and HTML5 doctype page
Comment 6 Martin Fousek 2014-08-01 06:32:58 UTC
Sorry, I'm not able to reproduce your problem in any way. There will be problem with the project setup:
"INFO [JsfSupportImpl]: project 'Maven[/home/arthur/Documentos/workspaces/fpti/turismo/portal-reservas/trunk/PortalReservas/pom.xml]' does not have source classpath; documentBase=/home/arthur/Documentos/workspaces/fpti/turismo/portal-reservas/trunk/PortalReservas/src@1660650e:55dc7614"

Please could you attach your pom.xml file (or at least important parts of it)? It looks that your document root is set to the src folder where I would expect rather source root. Which project type do you use? Is it Maven Web project? Thanks.
Comment 7 arthurgregorio 2014-08-04 12:29:05 UTC
Created attachment 148521 [details]
my pom

Yes, i have some particularities in my pom, one is the automatic generation of my SOAP webservice client classes...

i using the netbeans options to generate client ws from WSDL and and the code is automatically placed on my pom
Comment 8 Martin Fousek 2014-08-08 12:31:37 UTC
(In reply to arthurgregorio from comment #7)
> Created attachment 148521 [details]
> my pom
> 
> Yes, i have some particularities in my pom, one is the automatic generation
> of my SOAP webservice client classes...
> 
> i using the netbeans options to generate client ws from WSDL and and the
> code is automatically placed on my pom

And in which folder are you facelets placed? Is it <..>/PortalReservas/src?
Comment 9 arthurgregorio 2014-08-08 12:42:10 UTC
(In reply to Martin Fousek from comment #8)
> (In reply to arthurgregorio from comment #7)
> > Created attachment 148521 [details]
> > my pom
> > 
> > Yes, i have some particularities in my pom, one is the automatic generation
> > of my SOAP webservice client classes...
> > 
> > i using the netbeans options to generate client ws from WSDL and and the
> > code is automatically placed on my pom
> 
> And in which folder are you facelets placed? Is it <..>/PortalReservas/src?

in PortalReservas/src/main/webapp

i solved the problem changing the auto-generated code in my pom by some other configs diferent of the netbeans code.

it seems he mess entire folder source folder.
Comment 10 Martin Fousek 2014-08-08 13:09:38 UTC
(In reply to arthurgregorio from comment #9)
> i solved the problem changing the auto-generated code in my pom by some
> other configs diferent of the netbeans code.
> 
> it seems he mess entire folder source folder.

Please could you send us diff you did into the pom.xml and exactly which feature mess that up? We can try to fix that (i.e. the WS generator). Thanks a lot!
Comment 11 arthurgregorio 2014-08-08 13:22:10 UTC
Created attachment 148606 [details]
the diff from old pom

basically what I did was remove the folders and files that the IDE generates and make the maven plugin generate classes in every build based on the URL of the service, without the need to have the WSDL in the project.
Comment 12 arthurgregorio 2014-08-08 13:25:16 UTC
would be interesting if there was the possibility of allowing the user to select how want to generate the client classes, maybe this way I'm doing without having the WSDL in the project could be one, without the need to create a subdirectory of codes and avoiding these problems about reference ...
Comment 13 Martin Fousek 2014-08-15 05:51:28 UTC
Your JSF issues are cause by the generated "webResources" section. I'm going to take a look what feature wrongly generated that. If you would be facing the same issue, remove that section from the pom.xml. But I believe that we will be able to fix that in the daily builds - you are not the only one who hit such a trouble.
Comment 14 Martin Fousek 2014-08-15 07:58:47 UTC
Reassigning to the webservices - more information will follow.
Comment 15 Martin Fousek 2014-08-15 08:02:30 UTC
Created attachment 148714 [details]
screenshot from the project view

The cause of the JSF malfunction seems to be broken project setup by "WebService from WSDL file" generation action. Once I tried that feature it includes into pom.xml file following part:
<webResources>
    <resource>
        <directory>src</directory>
        <targetPath>WEB-INF</targetPath>
        <includes>
            <include>jax-ws-catalog.xml</include>
            <include>wsdl/**</include>
        </includes>
    </resource>
</webResources>
That marks whole 'src' folder as a web root which doesn't look to be correct.

At least tow users were already complaining about that and in both cases they didn't need to have such a piece of code in their pom.xml - is it necessary from point of view of WebServices?
Comment 16 Martin Fousek 2014-08-15 08:07:50 UTC
CCing pggeldenhuys who was facing the same troubles.
Comment 17 pggeldenhuys 2014-08-15 09:10:11 UTC
Also solved the issue by removing:
<webResources>
    <resource>
        <directory>src</directory>
        <targetPath>WEB-INF</targetPath>
    </resource>
</webResources>
from my pom, but yes the ws gen code needs to have a re-look.
Comment 18 Milan Kuchtiak 2014-08-15 10:48:57 UTC
From the screenshot you attached, problem seems to be in jaxws-maven-plugin:2.3 execution. 

This is likely the problem of parsing schema in jdk1.8.

Access to XML schema (WSDL) is restricted by default in jdk1.8.

The solution is either to start netbeans with:
-J-Djavax.xml.accessExternalSchema=all

or (better), include the following JVM option into pom.xml:
...
<plugin>
  <groupId>org.jvnet.jax-ws-commons</groupId>
  <artifactId>jaxws-maven-plugin</artifactId>
  <version>2.3</version>
  <executions>
     <execution>
        <goals>
           <goal>wsimport</goal>
        </goals>
        <configuration>
            <wsdlFiles>
               <wsdlFile>ws/WSTUR004.apw.wsdl</wsdlFile>
            </wsdlFiles>
            <vmArgs>
               <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
            </vmArgs>
            <packageName>ws.wstur004</packageName>
        </configuration>

See also the issue 241570.

See also: http://wiki.netbeans.org/FaqWSDLExternalSchema
We may add this JVM option automatically for jaxws-maven-plugin.

Please, confirm if this is the issue.
Comment 19 arthurgregorio 2014-08-15 12:19:18 UTC
i can't test if its solve the problem because i already solved with another approach.

I changed the generated configuration by generating the ws client dynamically by the wsdl URL

See:

<plugin>
    <groupId>org.jvnet.jax-ws-commons</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.1</version>
    <executions>
        <execution>
            <id>wsimport-generate-wstur004</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>wsimport</goal>
            </goals>
            <configuration>
                <wsdlUrls>
                    <wsdlUrl>${ws.base}WSTUR004.apw?WSDL</wsdlUrl>
                </wsdlUrls>
                <packageName>ws.wstur004</packageName>
            </configuration>
        </execution>
    </executions>
</plugin>

As I suggested earlier, if the customer uses the url of the wsdl to generate the client would be interesting not having to bring it to the project (since ws can still change) and use this setting, where each build the wsdl is accessed and client files will always be updated. 

If the user has the wsdl in the project, put it directly in web-inf is also something better than having separate folders and in the end it all goes in there.
Comment 20 Milan Kuchtiak 2014-08-15 13:57:08 UTC
Keeping wsdl locally is useful when working offline.
You may also make jaxb customization on that local wsdl, without changing the contract (original wsdl) between the server and the client. 

Don't remember cases when wsdl file was also needed in runtime.
Will consult that with JAX-WS team whether this is needed anymore.
Comment 21 Martin Balin 2016-07-07 09:54:06 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss