-
Type: Question
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: WebEngine
-
Upgrade notes:Hide
Josh Fletcher 1 hour ago
You should start with a ticket, especially if it’s an important issue.
Stan Sokolov 1 hour agoI have not see one of my ticket ever being looked upon
Stan Sokolov 1 hour agoI will create a ticket
Josh Fletcher 1 hour agoI understand, but a slack post definitely won’t be “worked on”.
Anahide Tchertchian 1 hour agoa deployment fragment is not a nuxeo component: it's a specific contribution relying on specific templating features: these changes are done even before the nuxeo runtime starts (edited)
Anahide Tchertchian 1 hour agosee doc at https://doc.nuxeo.com/nxdoc/understanding-bundles-deployment/#deployment-fragment-resources-processing
!https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fdoc.nuxeo.com%2Fassets%2Ficons%2Fapple-touch-icon.png%3Fv%3Dc2d5|width=16,height=16!Nuxeo Documentation
Understanding Bundles Deployment
The Nuxeo Platform deployment is incremental: the startup process involves different phases. (2 kB)
https://doc.nuxeo.com/nxdoc/understanding-bundles-deployment/#deployment-fragment-resources-processing
Stan Sokolov 1 hour agohttps://jira.nuxeo.com/browse/NXP-31421
Stan Sokolov 1 hour agoAnahide, how does it help ?
Josh Fletcher 1 hour agoJust in case, have you already seen https://github.com/tiry/nuxeo-scim-server?
Stan Sokolov 1 hour ago^^^ that what I am trying to get back to life
!https://a.slack-edge.com/production-standard-emoji-assets/14.0/apple-small/1f44d@2x.png!1
Stan Sokolov 1 hour agothis is 2014 old project I forked and trying to make ti work
Stan Sokolov 1 hour agosorry, I am struggling with this for the last 2 weeks and client resource does too
Stan Sokolov 1 hour agowe both can not fix it
Stan Sokolov 1 hour agowe could not even make this deployment-fragment be deployed
Josh Fletcher 1 hour agoAnd actually Stan, I should have been more clear: you need a SUPNXP to help with the prioritization.
Anahide Tchertchian 1 hour agoI'm just telling you that your current conf will never work: this deployment fragment is not a nuxeo component
Stan Sokolov 1 hour agoI have created deployment-fragment.xml exactly as documentaiton says
Stan Sokolov 1 hour agoimage.png
Stan Sokolov 1 hour agowhat is wrong about it ?
Stan Sokolov 1 hour agoit is just ignored ? I can copy JPEG picture inside - nothing will make any difference
Antoine Taillefer 1 hour agohave you checked the generated ./nxserver/nuxeo.war/WEB-INF/web.xml file in the Nuxe server?
Anahide Tchertchian 1 hour agothe best examples you can find are probably in the nuxeo-jsf-ui repo, https://github.com/nuxeo/nuxeo-jsf-ui/blob/master/code/nuxeo-platform-ui-web/src/main/resources/OSGI-INF/deployment-fragment.xml
deployment-fragment.xml
```
?xml version="1.0"?
fragment version="1" requireorg.nuxeo.runtime.nuxeo-runtime-deploy[/require|https://nuxeo.slack.com/require] extension target="web#LISTENER"
<!-- Don't register com.sun.faces.config.ConfigureListener
it is already discovered when Jasper scans jsf-impl's jsf_core.tld
Show more
nuxeo/nuxeo-jsf-ui | Added by a bot
Stan Sokolov 1 hour agohow is it different from what I have done ?
Anahide Tchertchian 1 hour agonot sure, tbh, I have not started a nuxeo server in more than a year. maybe the require part?
Stan Sokolov 1 hour agoI have require part
Antoine Taillefer 1 hour agoplease, check the server logs at startup and the generated web.xml file, it's the target file to which your deployment-fargment.xml is supposed to contribute
!https://a.slack-edge.com/production-standard-emoji-assets/14.0/apple-small/1f44d@2x.png!1
Stan Sokolov 1 hour agoit does not work in test environment. I can not even make embeded container to pick this file up
Stan Sokolov 1 hour agothe only way to make embeded container work is to do “standard extension” model
Stan Sokolov 1 hour agolook at this
Stan Sokolov 1 hour agoSee this is regular contribution. It works when a test is run. I did not change the test - the same test was in SCIM project from the beginning
image.png
Stan Sokolov 1 hour agoand it only works when there is a component based setup of extensions to webengine.
Stan Sokolov 1 hour agohowever when all build and tested, then packaged - and deployed to the server. This type of configuraiton does not work. It says component org.nuxeo.runtime.server is not found.
Stan Sokolov 1 hour agoOk fair enough. I am going to documentation and it says - use deployment-fragment instead. No problem. I am removing this component based extension and creating deployment-fragment.xml file. However it is ignored
Stan Sokolov 1 hour agowhen I run tests,
Stan Sokolov 1 hour agoimage.png
Antoine Taillefer 1 hour agoso yes, the org.nuxeo.runtime.server is only for tests, not embedded in a server, on the contrary, the deployment-fargment.xml system will only work in a server, no in tests (AFAIK), it's for preprocessing handled by nuxeoctl (edited)
Antoine Taillefer 1 hour agoso, regular XML contrib for tests, deployment-fragment for runtime (server)
Stan Sokolov 1 hour agoamazing (not)… So I have to modify MANIFEST.xml before and after running the unit test.
MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 1
Bundle-Name: fidelity-scim-server
Bundle-SymbolicName: fidelity.ctg.csp.scim.server;singleton:=true
Bundle-Vendor: Nuxeo
Click to expand inline (9 lines)
Stan Sokolov 1 hour agoFor running unit tests I have to get
servlet_extension.xml
<?xml version="1.0"?>
<component name="org.nuxeo.scim.server.ScimServletSetup">
<require>org.nuxeo.runtime.server</require>
<extension target="org.nuxeo.runtime.server" point="servlet">
Click to expand inline (98 lines)
Stan Sokolov 1 hour agowell I will figure it out but it is wierd
Josh Fletcher 1 hour agoYou don’t have to modify anything for running tests, no one is saying that.
Stan Sokolov 1 hour agowell I have to, tests should be run with one config and production with another
Josh Fletcher 1 hour agoForgive my ignorance: isn’t that what the test folder is for?
Stan Sokolov 1 hour agoI know what it is for, but it is a DIFFERENT version of config
Stan Sokolov 1 hour agoone config has to be tested for test and another one (potentially completely different) tested in server
Stan Sokolov 1 hour agoso one always has to be somehow copied in another
Stan Sokolov 1 hour agoeven syntax is different
Josh Fletcher 1 hour agoSorry I really am out of my depth so I’ll shut up
Stan Sokolov 1 hour agopoint is having the same config for prod and test is essential. I have already seen how queries written for H2 db fail with mongo db. The same story here. Sure I create two different configs - 1 for test 2 for runtime - and hope it works
Stan Sokolov 1 hour agobut I do not like it by every single bit
Stan Sokolov 45 minutes agohow much time it will take for me to test deployment-fragment.xml without being able to run unit test with it. Build a SCIM package. Add this package to a client package. Build client package. Deploy client package to a nuxeo server. Go manually check that web.xml file was updated. Go manually check if URL is accessible … awesome…. just awesome
Josh Fletcher 38 minutes agoI don’t think the suggestion to check web.xml was a solution, it was a troubleshooting step. That’s the way I took it anyway.
Stan Sokolov 34 minutes agolet me show on example
Stan Sokolov 33 minutes agothis is how servlet is defined in delployment-fragment.xml (notice servlet mapping section)
Stan Sokolov 33 minutes agoimage.png
Stan Sokolov 32 minutes agothis is how the same servlet is defined in extension contribution
Stan Sokolov 32 minutes agoimage.png
Stan Sokolov 32 minutes agocontext attribute defines a mapping
Stan Sokolov 31 minutes agodifferences like this can play a role when one config is tested and second does not work
Stan Sokolov 31 minutes agoahh
Stan Sokolov 31 minutes agoanyway, thank you everyone for help, it least I know what to try now
Stan Sokolov 28 minutes agoand it would be very well worth the effort to explain in documentation that deployment-fragment.xml will not work in unit test environment
https://doc.nuxeo.com/nxdoc/webengine-jax-rs/
Stan Sokolov 27 minutes agowith making deployment-fragment.xml also honest saying that just defining a servlet is not going to do anything. Because it is a different url, inheritance from base is no longer working, so every single filter and resource servlets have to be redefined
Stan Sokolov 26 minutes agoimage.png
Stan Sokolov 26 minutes ago^^^ good luck doing this without redeclaring every other servlet/filter that listen to default /site endpoint
Stan Sokolov 10 minutes ago8 filters have to be declared in particular order to get new host to work. how client would know this
Stan Sokolov 2 minutes agobut now it works localhost:8080/nuxeo/scim_host/scim/v1/Users/Administrator
Stan Sokolov 2 minutes agoyahoo!!!
Stan Sokolov 2 minutes agoimage.png
ShowJosh Fletcher 1 hour ago You should start with a ticket, especially if it’s an important issue. Stan Sokolov 1 hour ago I have not see one of my ticket ever being looked upon Stan Sokolov 1 hour ago I will create a ticket Josh Fletcher 1 hour ago I understand, but a slack post definitely won’t be “worked on”. Anahide Tchertchian 1 hour ago a deployment fragment is not a nuxeo component: it's a specific contribution relying on specific templating features: these changes are done even before the nuxeo runtime starts (edited) Anahide Tchertchian 1 hour ago see doc at https://doc.nuxeo.com/nxdoc/understanding-bundles-deployment/#deployment-fragment-resources-processing !https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fdoc.nuxeo.com%2Fassets%2Ficons%2Fapple-touch-icon.png%3Fv%3Dc2d5|width=16,height=16!Nuxeo Documentation Understanding Bundles Deployment The Nuxeo Platform deployment is incremental: the startup process involves different phases. (2 kB) https://doc.nuxeo.com/nxdoc/understanding-bundles-deployment/#deployment-fragment-resources-processing Stan Sokolov 1 hour ago https://jira.nuxeo.com/browse/NXP-31421 Stan Sokolov 1 hour ago Anahide, how does it help ? Josh Fletcher 1 hour ago Just in case, have you already seen https://github.com/tiry/nuxeo-scim-server ? Stan Sokolov 1 hour ago ^^^ that what I am trying to get back to life !https://a.slack-edge.com/production-standard-emoji-assets/14.0/apple-small/1f44d@2x.png!1 Stan Sokolov 1 hour ago this is 2014 old project I forked and trying to make ti work Stan Sokolov 1 hour ago sorry, I am struggling with this for the last 2 weeks and client resource does too Stan Sokolov 1 hour ago we both can not fix it Stan Sokolov 1 hour ago we could not even make this deployment-fragment be deployed Josh Fletcher 1 hour ago And actually Stan, I should have been more clear: you need a SUPNXP to help with the prioritization. Anahide Tchertchian 1 hour ago I'm just telling you that your current conf will never work: this deployment fragment is not a nuxeo component Stan Sokolov 1 hour ago I have created deployment-fragment.xml exactly as documentaiton says Stan Sokolov 1 hour ago image.png Stan Sokolov 1 hour ago what is wrong about it ? Stan Sokolov 1 hour ago it is just ignored ? I can copy JPEG picture inside - nothing will make any difference Antoine Taillefer 1 hour ago have you checked the generated ./nxserver/nuxeo.war/WEB-INF/web.xml file in the Nuxe server? Anahide Tchertchian 1 hour ago the best examples you can find are probably in the nuxeo-jsf-ui repo, https://github.com/nuxeo/nuxeo-jsf-ui/blob/master/code/nuxeo-platform-ui-web/src/main/resources/OSGI-INF/deployment-fragment.xml deployment-fragment.xml ``` ?xml version="1.0"? fragment version="1" require org.nuxeo.runtime.nuxeo-runtime-deploy[/require|https://nuxeo.slack.com/require] extension target="web#LISTENER" <!-- Don't register com.sun.faces.config.ConfigureListener it is already discovered when Jasper scans jsf-impl's jsf_core.tld Show more nuxeo/nuxeo-jsf-ui | Added by a bot Stan Sokolov 1 hour ago how is it different from what I have done ? Anahide Tchertchian 1 hour ago not sure, tbh, I have not started a nuxeo server in more than a year. maybe the require part? Stan Sokolov 1 hour ago I have require part Antoine Taillefer 1 hour ago please, check the server logs at startup and the generated web.xml file, it's the target file to which your deployment-fargment.xml is supposed to contribute !https://a.slack-edge.com/production-standard-emoji-assets/14.0/apple-small/1f44d@2x.png!1 Stan Sokolov 1 hour ago it does not work in test environment. I can not even make embeded container to pick this file up Stan Sokolov 1 hour ago the only way to make embeded container work is to do “standard extension” model Stan Sokolov 1 hour ago look at this Stan Sokolov 1 hour ago See this is regular contribution. It works when a test is run. I did not change the test - the same test was in SCIM project from the beginning image.png Stan Sokolov 1 hour ago and it only works when there is a component based setup of extensions to webengine. Stan Sokolov 1 hour ago however when all build and tested, then packaged - and deployed to the server. This type of configuraiton does not work. It says component org.nuxeo.runtime.server is not found. Stan Sokolov 1 hour ago Ok fair enough. I am going to documentation and it says - use deployment-fragment instead. No problem. I am removing this component based extension and creating deployment-fragment.xml file. However it is ignored Stan Sokolov 1 hour ago when I run tests, Stan Sokolov 1 hour ago image.png Antoine Taillefer 1 hour ago so yes, the org.nuxeo.runtime.server is only for tests, not embedded in a server, on the contrary, the deployment-fargment.xml system will only work in a server, no in tests (AFAIK), it's for preprocessing handled by nuxeoctl (edited) Antoine Taillefer 1 hour ago so, regular XML contrib for tests, deployment-fragment for runtime (server) Stan Sokolov 1 hour ago amazing (not)… So I have to modify MANIFEST.xml before and after running the unit test. MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 1 Bundle-Name: fidelity-scim-server Bundle-SymbolicName: fidelity.ctg.csp.scim.server;singleton:=true Bundle-Vendor: Nuxeo Click to expand inline (9 lines) Stan Sokolov 1 hour ago For running unit tests I have to get servlet_extension.xml <?xml version="1.0"?> <component name="org.nuxeo.scim.server.ScimServletSetup"> <require>org.nuxeo.runtime.server</require> <extension target="org.nuxeo.runtime.server" point="servlet"> Click to expand inline (98 lines) Stan Sokolov 1 hour ago well I will figure it out but it is wierd Josh Fletcher 1 hour ago You don’t have to modify anything for running tests, no one is saying that. Stan Sokolov 1 hour ago well I have to, tests should be run with one config and production with another Josh Fletcher 1 hour ago Forgive my ignorance: isn’t that what the test folder is for? Stan Sokolov 1 hour ago I know what it is for, but it is a DIFFERENT version of config Stan Sokolov 1 hour ago one config has to be tested for test and another one (potentially completely different) tested in server Stan Sokolov 1 hour ago so one always has to be somehow copied in another Stan Sokolov 1 hour ago even syntax is different Josh Fletcher 1 hour ago Sorry I really am out of my depth so I’ll shut up Stan Sokolov 1 hour ago point is having the same config for prod and test is essential. I have already seen how queries written for H2 db fail with mongo db. The same story here. Sure I create two different configs - 1 for test 2 for runtime - and hope it works Stan Sokolov 1 hour ago but I do not like it by every single bit Stan Sokolov 45 minutes ago how much time it will take for me to test deployment-fragment.xml without being able to run unit test with it. Build a SCIM package. Add this package to a client package. Build client package. Deploy client package to a nuxeo server. Go manually check that web.xml file was updated. Go manually check if URL is accessible … awesome…. just awesome Josh Fletcher 38 minutes ago I don’t think the suggestion to check web.xml was a solution , it was a troubleshooting step. That’s the way I took it anyway. Stan Sokolov 34 minutes ago let me show on example Stan Sokolov 33 minutes ago this is how servlet is defined in delployment-fragment.xml (notice servlet mapping section) Stan Sokolov 33 minutes ago image.png Stan Sokolov 32 minutes ago this is how the same servlet is defined in extension contribution Stan Sokolov 32 minutes ago image.png Stan Sokolov 32 minutes ago context attribute defines a mapping Stan Sokolov 31 minutes ago differences like this can play a role when one config is tested and second does not work Stan Sokolov 31 minutes ago ahh Stan Sokolov 31 minutes ago anyway, thank you everyone for help, it least I know what to try now Stan Sokolov 28 minutes ago and it would be very well worth the effort to explain in documentation that deployment-fragment.xml will not work in unit test environment https://doc.nuxeo.com/nxdoc/webengine-jax-rs/ Stan Sokolov 27 minutes ago with making deployment-fragment.xml also honest saying that just defining a servlet is not going to do anything. Because it is a different url, inheritance from base is no longer working, so every single filter and resource servlets have to be redefined Stan Sokolov 26 minutes ago image.png Stan Sokolov 26 minutes ago ^^^ good luck doing this without redeclaring every other servlet/filter that listen to default /site endpoint Stan Sokolov 10 minutes ago 8 filters have to be declared in particular order to get new host to work. how client would know this Stan Sokolov 2 minutes ago but now it works localhost:8080/nuxeo/scim_host/scim/v1/Users/Administrator Stan Sokolov 2 minutes ago yahoo!!! Stan Sokolov 2 minutes ago image.png
Can someone explain why deployment-fragment.xml is ignored ? documentation says if it is placed in the proper place it should allow to add mapping for additional servlet/filter resources. Does not do that. When I try to do the same using regular extension model (<extension target=“org.nuxeo.runtime.server” point=“servlet”>) it works during the test cycle but when deployed to server it says that service service:org.nuxeo.runtime.server is not available. service:org.nuxeo.scim.server.ScimServletSetup requires [service:org.nuxeo.runtime.server] . I am trying to not be emotional but it is killing so much time to get something so simple working that I can only imagine who much frustration clients have when trying to make this thing to work. I am attaching src code. This issue is not going to go away. Fidelity is the biggest client we have and they need SCIM server. Like it or not but it has to be addressed.
- image-2022-11-16-11-56-10-559.png
- 491 kB
- Stan Sokolov