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.
I have a Maven property placeholder in my glassfish-web.xml for the context root called ${fdb.context}. When I run with my appropriate Maven profile I encounter: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: javax.faces.FacesException: java.net.URISyntaxException: Illegal character in path at index 14: jndi:/server/${fdb.context}/WEB-INF/faces-config.xml at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:751) at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:349) In summary: * JavaEE7 project * Glassfish4 * If I deploy my ejb module which uses the web module it deploys correctly. * If I deploy my war module directly it fails. The built files in web/target are all correctly built. I'm wondering why NB doesn't "honor this".
Not sure if I understand you correctly, but are you trying to use properties defined in pom.xml within glassfish-web.xml file? Are you able to deploy your application without using NetBeans?
Yes, that's what I'm trying to do. I can successfully package my application as either WAR (or wrap it into an EAR) and deploy it manually. I does this continually. But I can not deploy the WAR to Glassfish4 inside NetBeans.
Ye, I guess this is caused by the fact that you are trying to "run" your application. You should be able to "deploy" it correctly even using NetBeans but when you want to run it, NetBeans needs to evaluate what URL needs to be open in the browser and in that case it's trying to resolve ${fdb.context} which is not possible (as far as I know Maven properties mechanism doesn't have anything in common with other xml files except the Maven ones - pom.xml, settings.xml etc.).
I'm not sure what you mean by "in common" here. When I hit run the Maven profile is invoked: mvn.bat -Dnetbeans.deploy.debugmode=true -Dnetbeans.deploy=true -PTest package When the correct profile is invoked, the ${fdb.context} property is filtered into glassfish-web.xml. After building, I can see that the property is successfully filtered. Otherwise, the WAR would be corrupt, but it is not. The question becomes: where does NetBeans read the context from if not glassfish-web.xml?
(In reply to matsa from comment #4) > The question becomes: where does NetBeans read the context from if not > glassfish-web.xml? I don't know. Do you think it would be possible to create simple project configured as much simple as possible where I would be able to reproduce and debug the problem?
I will do this first thing in the morning when I get into work. :)
Created attachment 140616 [details] simple enterprise project Created a simple enterprise project with using maven archetype with context-root filtered into glassfish-web.xml (war module) and into application.xml (ear module). Deploying to Glassfish4 from NetBeans yields: * war module: "Loading application [SampleProject-web] at [/${fdb.context}]" * ear module: Loading application [SampleProject-web] at [/FdbWeb]
I'm sorry for such a late response. I tried to reproduce the problem using your sample project, but it seems to be working correctly. When I clean install given web project and run it, the browser is correctly opened on url "http://localhost:8080/fdb.context/" ...which is fine given your context root setting (<context-root>fdb.context</context-root>). How exactly are you reproducing incorrect behavior? And what version of NetBeans are you using?
Hey! I'm just glad someone remembered! :) It's not supposed to be http://localhost:8080/fdb.context/. fdb.context is a Maven property placeholder which is supposed to be replaced by the value "FdbWeb" from the Maven pom. The source folder glassfish-web.xml says <context-root>${fdb.context}</context-root>. Might I suggest you try to read my description again because I think you've misunderstood something. I'll do my best to try and clarify anything.
(In reply to matsa from comment #9) > It's not supposed to be http://localhost:8080/fdb.context/. fdb.context is a > Maven property placeholder which is supposed to be replaced by the value > "FdbWeb" from the Maven pom. Ahaa.. I'm sorry, I didn't notice that. Think I understand now and I'll take a look at it.
Mmm, not sure if this has any simple fix. The difference is that during EAR deployment the correct context path is read from your maven-ear-plugin (you do have configured it in configuration/webModule/contextRoot). But in this case it's simple to evaluate the correct value, because we simply use effective pom that evaluates the property placeholders even from parent pom. On the other hand when you are using maven placeholders in glassfish-web.xml it's not really straightforward to evaluate what you want (Glassfish plugin don't have any idea about building tool you are using - Maven in that case). Don't know maybe I'm wrong but I would say if you build your war file manually and then manually deploy it to the GlassFish, I doubt it will be available on the URL you are expecting (but of course I might be wrong and in that case we should try to workaround it somehow in NetBeans)
To be able to fix such an issue we would have to build whole effective pom up during the deployment (which is not available at the moment because deployment infrastructure doesn't care about any build tool specifics) and then try to read property holder from it. Not really simple issue but I guess it's possible to fix this problem. On the other hand I don't believe it makes much sense to do that with respect to the current benefits (there is simple workarround and not many people are using Maven property placeholders like this). Anyway letting issue open and setting TM = Next for now.
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