Issue with enabling Spring Controller.

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with enabling Spring Controller.

Saurabh Tripathi
This post was updated on .
Dear All, I am using dotCMS 4.1.1. I want to enable spring rest controller in dotCMS for saving form data using REST API in the backend. For the trial purpose, I have done following:
  1. Downloaded com.dotcms.spring example from https://github.com/dotCMS/plugin-seeds/tree/release-4.1.1
  2. Run gradlew clean command.
  3. Run gradlew build command to build the jar of the example.
  4. Uploaded jar file to plugins using dotCMS UI.
  5. Added package names in Exported Packages list.
  6. Restarted the OSGi framework using UI.
But it shows following error:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [com.dotmarketing.osgi.spring.ExampleController] for bean with name
'exampleController' defined in ServletContext resource [/spring/example-servlet.xml];
nested exception is java.lang.ClassNotFoundException:
com.dotmarketing.osgi.spring.ExampleController
And when I tried to run the example using eclipse and tomcat. Tomcat server failed to start showing following error:
INFO  2017-10-26 12:04:04,239 [localhost-startStop-1] com.dotmarketing.util.Config:info(58): Initializing properties reader.
INFO  2017-10-26 12:04:04,243 [localhost-startStop-1] com.dotmarketing.util.Config:info(58): Loading dotCMS [dotmarketing-config.properties] Properties...
FATAL 2017-10-26 12:04:04,270 [localhost-startStop-1] com.dotmarketing.util.Config:fatal(156): Exception loading properties for file [dotmarketing-config.properties]
java.io.FileNotFoundException: file:\C:\apache-tomcat-8.0.42\wtpwebapps\com.dotcms.spring\WEB-INF\lib\dotcms-4.1.1.jar!\dotmarketing-config.properties (The filename, directory name, or volume label syntax is incorrect)
	at java.io.FileInputStream.open(Native Method) ~[?:1.8.0_25]
	at java.io.FileInputStream.(FileInputStream.java:138) ~[?:1.8.0_25]
	at com.dotmarketing.util.Config.readProperties(Config.java:242) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.readProperties(Config.java:173) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config._loadProperties(Config.java:153) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config._refreshProperties(Config.java:291) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.getStringProperty(Config.java:315) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.getStringProperty(Config.java:302) [dotcms-4.1.1.jar:?]
	at com.dotcms.util.marshal.MarshalFactory.getMarshalUtils(MarshalFactory.java:79) [dotcms-4.1.1.jar:?]
	at com.dotcms.rest.api.v1.system.websocket.SystemEventEncoder.(SystemEventEncoder.java:22) [dotcms-4.1.1.jar:?]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_25]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_25]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_25]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [?:1.8.0_25]
	at java.lang.Class.newInstance(Class.java:438) [?:1.8.0_25]
	at org.apache.tomcat.websocket.server.WsServerContainer.validateEncoders(WsServerContainer.java:527) [tomcat-websocket.jar:8.0.42]
	at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:255) [tomcat-websocket.jar:8.0.42]
	at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:120) [tomcat-websocket.jar:8.0.42]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) [catalina.jar:8.0.42]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [catalina.jar:8.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [catalina.jar:8.0.42]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_25]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
INFO  2017-10-26 12:04:04,287 [localhost-startStop-1] com.dotmarketing.util.Config:info(58): Loading dotCMS [dotcms-config-cluster.properties] Properties...
FATAL 2017-10-26 12:04:04,287 [localhost-startStop-1] com.dotmarketing.util.Config:fatal(156): Exception loading properties for file [dotcms-config-cluster.properties]
java.io.FileNotFoundException: file:\C:\apache-tomcat-8.0.42\wtpwebapps\com.dotcms.spring\WEB-INF\lib\dotcms-4.1.1.jar!\dotcms-config-cluster.properties (The filename, directory name, or volume label syntax is incorrect)
	at java.io.FileInputStream.open(Native Method) ~[?:1.8.0_25]
	at java.io.FileInputStream.(FileInputStream.java:138) ~[?:1.8.0_25]
	at com.dotmarketing.util.Config.readProperties(Config.java:242) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.readProperties(Config.java:175) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config._loadProperties(Config.java:153) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config._refreshProperties(Config.java:291) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.getStringProperty(Config.java:315) [dotcms-4.1.1.jar:?]
	at com.dotmarketing.util.Config.getStringProperty(Config.java:302) [dotcms-4.1.1.jar:?]
	at com.dotcms.util.marshal.MarshalFactory.getMarshalUtils(MarshalFactory.java:79) [dotcms-4.1.1.jar:?]
	at com.dotcms.rest.api.v1.system.websocket.SystemEventEncoder.(SystemEventEncoder.java:22) [dotcms-4.1.1.jar:?]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_25]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_25]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_25]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [?:1.8.0_25]
	at java.lang.Class.newInstance(Class.java:438) [?:1.8.0_25]
	at org.apache.tomcat.websocket.server.WsServerContainer.validateEncoders(WsServerContainer.java:527) [tomcat-websocket.jar:8.0.42]
	at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:255) [tomcat-websocket.jar:8.0.42]
	at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:120) [tomcat-websocket.jar:8.0.42]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) [catalina.jar:8.0.42]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) [catalina.jar:8.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [catalina.jar:8.0.42]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [catalina.jar:8.0.42]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_25]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_25]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
INFO  2017-10-26 12:04:04,288 [localhost-startStop-1] com.dotmarketing.util.Config:info(58): Assigned  refresh: 5 minutes.
Oct 26, 2017 12:04:04 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/com.dotcms.spring]]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/com.dotcms.spring]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	... 6 more
Caused by: java.lang.NullPointerException
	at com.dotmarketing.util.Config.readProperties(Config.java:207)
	at com.dotmarketing.util.Config._loadProperties(Config.java:153)
	at com.dotmarketing.util.Config._refreshProperties(Config.java:291)
	at com.dotmarketing.util.Config.getStringProperty(Config.java:315)
	at com.dotmarketing.util.Config.getStringProperty(Config.java:302)
	at com.dotcms.util.marshal.MarshalFactory.getMarshalUtils(MarshalFactory.java:79)
	at com.dotcms.rest.api.v1.system.websocket.SystemEventEncoder.(SystemEventEncoder.java:22)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
	at java.lang.Class.newInstance(Class.java:438)
	at org.apache.tomcat.websocket.server.WsServerContainer.validateEncoders(WsServerContainer.java:527)
	at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:255)
	at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:120)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 6 more

Oct 26, 2017 12:04:04 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 6 more

Oct 26, 2017 12:04:04 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 11 more

Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-nio-8009"]
Oct 26, 2017 12:04:04 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]
Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol destroy
SEVERE: Failed to destroy end point associated with ProtocolHandler ["http-nio-8080"]
java.lang.NullPointerException
	at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315)
	at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491)
	at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:883)
	at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
	at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]
Oct 26, 2017 12:04:04 PM org.apache.coyote.AbstractProtocol destroy
SEVERE: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.NullPointerException
	at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315)
	at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491)
	at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:883)
	at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
	at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879)
	at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Please help me in finding what I am doing wrong. Thanks.
Reply | Threaded
Open this post in threaded view
|

RE: Issue with enableing Spring Controller.

Chris Schmitt
Looking at that repo, it looks like there's a pull request that fixes/updates that plugin to work with 4.1.1, it just hasn't been merged yet.

You could make all the changes Will did in his commits, but that would be kinda painful. There's ways in git to make patches out of commits, but I'm not familiar enough with git to know how to do that with pull request commits. Thankfully, there's Google: https://www.google.com/search?q=git+create+patch+from+pull+request

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Saurabh Tripathi
Sent: Thursday, October 26, 2017 3:02 AM
To: [hidden email]
Subject: [dotcms] Issue with enableing Spring Controller.

Dear All,

I am using dotCMS 4.1.1. I want to enable spring rest controller in dotCMS
for saving form data using REST API  in the backend. For the trial purpose,
I have done following:
     1. Downloaded com.dotcms.spring example from
https://github.com/dotCMS/plugin-seeds/tree/release-4.1.1
     2. Run gradlew clean command.
     3. Run gradlew build command to build the jar of the example.
     4. Uploaded jar file to plugins using dotCMS UI.

But it shows following error:
*org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
clas
s [com.dotmarketing.osgi.spring.ExampleController] for bean with name
'exampleCo
ntroller' defined in ServletContext resource [/spring/example-servlet.xml];
nest
ed exception is java.lang.ClassNotFoundException:
com.dotmarketing.osgi.spring.E
xampleController*

Please help me in finding what I am doing wrong.

Thanks.



--
Sent from: http://forumarchive.dotcms.com/

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509001333391-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/e251931c67d246cbaec35542c19bc78e%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enableing Spring Controller.

Jonathan Gamba
In reply to this post by Saurabh Tripathi
Good morning, we recently released the 4.2 version of dotCMS, in that release we addressed multiple issues with OSGI, you could try to use the 4.2 version of the Spring OSGI plugin https://github.com/dotCMS/plugin-seeds/tree/release-4.2/OSGi/com.dotcms.spring
You will find multiple small but important changes on that plugin so my recommendation is that even if you are using dotCMS 4.1.1 (also if possible, probably not, but moving completely to 4.2 will be a good choice) try to use the 4.2 version of the plugin.
Please start from there and I will follow this thread in order to help in case you find more problems with the plugin.

--
Jonathan Gamba 

On Thursday, October 26, 2017 at 1:02:16 AM UTC-6, Saurabh Tripathi wrote:
Dear All,

I am using dotCMS 4.1.1. I want to enable spring rest controller in dotCMS
for saving form data using REST API  in the backend. For the trial purpose,
I have done following:
     1. Downloaded com.dotcms.spring example from
<a href="https://github.com/dotCMS/plugin-seeds/tree/release-4.1.1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FdotCMS%2Fplugin-seeds%2Ftree%2Frelease-4.1.1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEpv491gROCGRMNsVj8y56-FTCWMQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FdotCMS%2Fplugin-seeds%2Ftree%2Frelease-4.1.1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEpv491gROCGRMNsVj8y56-FTCWMQ&#39;;return true;">https://github.com/dotCMS/plugin-seeds/tree/release-4.1.1
     2. Run gradlew clean command.
     3. Run gradlew build command to build the jar of the example.
     4. Uploaded jar file to plugins using dotCMS UI.

But it shows following error:
*org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
clas
s [com.dotmarketing.osgi.spring.ExampleController] for bean with name
'exampleCo
ntroller' defined in ServletContext resource [/spring/example-servlet.xml];
nest
ed exception is java.lang.ClassNotFoundException:
com.dotmarketing.osgi.spring.E
xampleController*

Please help me in finding what I am doing wrong.

Thanks.



--
Sent from: <a href="http://forumarchive.dotcms.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fforumarchive.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFYjLhPlfmVKUY4_y6h83kFQKhMxw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fforumarchive.dotcms.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFYjLhPlfmVKUY4_y6h83kFQKhMxw&#39;;return true;">http://forumarchive.dotcms.com/

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/10c77716-f5e4-436f-8b31-a26660065207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Saurabh Tripathi
Thanks, Jonathan.

As suggested by you, I tried to test plugin for 4.2.0 release with dotCMS 4.1.1 and then for dotCMS 4.2.0 as well. In both the cases, I got the success log. Log for 4.2.0 release is:

[INFO] Initializing Spring FrameworkServlet 'class org.springframework.web.servlet.DispatcherServlet_1'
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
Started bundle: file:/E:/Dotcms/dotcms_4.2.0/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/com.dotcms.spring-0.1.jar
But when I tried to access the HelloWorld page on the browser with http://localhost:8080/app/spring/examplecontroller, I got 404 page.

One more question how and where I can get the controller calling log to debug?

Thanks.

Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509083922527-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Jason Tesser

On Fri, Oct 27, 2017 at 1:58 AM Saurabh Tripathi <[hidden email]> wrote:
Thanks, Jonathan.

As suggested by you, I tried to test plugin for 4.2.0 release with dotCMS 4.1.1 and then for dotCMS 4.2.0 as well. In both the cases, I got the success log. Log for 4.2.0 release is:

[INFO] Initializing Spring FrameworkServlet 'class org.springframework.web.servlet.DispatcherServlet_1'
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
Started bundle: file:/E:/Dotcms/dotcms_4.2.0/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/com.dotcms.spring-0.1.jar
But when I tried to access the HelloWorld page on the browser with http://localhost:8080/app/spring/examplecontroller, I got 404 page.

One more question how and where I can get the controller calling log to debug?

Thanks.

Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509083922527-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
--



3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAKKUxWcwfPAxgdbNxSmR1p_bSar%2BMzzOptpco7wnwMyd_nL_Cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Nathan Keiter

Also, if you just want to create a simple RESTful endpoint, the dotCMS plugin framework actually makes this very easy now. You don’t need the complexity of Spring anymore.

 

You can make a simply annotated class and then in the activator use RestServiceutil.addResource( MyRestService.class );

 

com.dotcms.rest.config.RestServiceUtil is the import.

 

com.dotcms.rest.WebResource is also helpful.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Jason Tesser
Sent: Friday, October 27, 2017 7:18 AM
To: [hidden email]
Subject: Re: [dotcms] Re: Issue with enabling Spring Controller.

 

 

On Fri, Oct 27, 2017 at 1:58 AM Saurabh Tripathi <[hidden email]> wrote:

Thanks, Jonathan.

As suggested by you, I tried to test plugin for 4.2.0 release with dotCMS 4.1.1 and then for dotCMS 4.2.0 as well. In both the cases, I got the success log. Log for 4.2.0 release is:

[INFO] Initializing Spring FrameworkServlet 'class org.springframework.web.servlet.DispatcherServlet_1'
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)]
Started bundle: file:/E:/Dotcms/dotcms_4.2.0/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/com.dotcms.spring-0.1.jar

But when I tried to access the HelloWorld page on the browser with http://localhost:8080/app/spring/examplecontroller, I got 404 page.

One more question how and where I can get the controller calling log to debug?

Thanks.


Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509083922527-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--

 

 

3059 Grand Avenue

Suite 410-B

Miami FL 33133

Main: 305-900-2001 | Direct: 978.294.9429

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAKKUxWcwfPAxgdbNxSmR1p_bSar%2BMzzOptpco7wnwMyd_nL_Cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/f4f39c5fc02b4e22bbd46111e16b0c18%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Saurabh Tripathi

Thanks, Nathan,

As suggested by you, I have tried to add a simple RESTful-endpoint in dotCMS plugin framework, but I got the following WARNING messages:

30-Oct-2017 10:58:48.690 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime A provider com.dotmarketing.osgi.spring.FormDataController registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.dotmarketing.osgi.spring.FormDataController will be ignored.
DEBUG: Bundle com.dotcms.spring [11] jersey-multipart-config.properties not found by com.dotcms.spring [11]
30-Oct-2017 10:58:49.336 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.Errors.logErrors The following warnings have been detected: WARNING: A HTTP GET method, public com.dotcms.repackage.javax.ws.rs.core.Response com.dotcms.rest.elasticsearch.ESContentResourcePortlet.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String) throws com.dotmarketing.exception.DotDataException,com.dotmarketing.exception.DotSecurityException, should not consume any entity.
example-Servlet.xml read succefully.
Started bundle: jardir:E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-
INF\felix\load\com.dotcms.spring-0.1

Please find the files in the attachment.

Also, it will be helpful if you can provide some relevant code for a POST request with JSON response in the context with dotCMS.

Looking forward to your support.

Thanks.

build.gradle
Activator.java
ExampleController.java
FormDataController.java
example-servlet.xml

Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509342331211-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Jason Tesser
So a couple of things. 

1. On your original issue did you try what I mentioned about the URL?  Cause it would return 404 without the trailing slash. 
2. I do NOT think you should do the class loader hack you added to your activator. We have ways of handling this as does OSGi.  
For example see here https://dotcms.com/docs/latest/override-a-dotcms-class-plugin  notice the Override-Classes

This being said as a best practice I would recommend having your OSGi plugins as isolated as possible.  By this I mean have the plugin provide all the libs it needs. https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.custom.spring



On Mon, Oct 30, 2017 at 1:45 AM Saurabh Tripathi <[hidden email]> wrote:

Thanks, Nathan,

As suggested by you, I have tried to add a simple RESTful-endpoint in dotCMS plugin framework, but I got the following WARNING messages:

30-Oct-2017 10:58:48.690 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime A provider com.dotmarketing.osgi.spring.FormDataController registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.dotmarketing.osgi.spring.FormDataController will be ignored.
DEBUG: Bundle com.dotcms.spring [11] jersey-multipart-config.properties not found by com.dotcms.spring [11]
30-Oct-2017 10:58:49.336 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.Errors.logErrors The following warnings have been detected: WARNING: A HTTP GET method, public com.dotcms.repackage.javax.ws.rs.core.Response com.dotcms.rest.elasticsearch.ESContentResourcePortlet.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String) throws com.dotmarketing.exception.DotDataException,com.dotmarketing.exception.DotSecurityException, should not consume any entity.
example-Servlet.xml read succefully.
Started bundle: jardir:E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-
INF\felix\load\com.dotcms.spring-0.1

Please find the files in the attachment.

Also, it will be helpful if you can provide some relevant code for a POST request with JSON response in the context with dotCMS.

Looking forward to your support.

Thanks.

build.gradle
Activator.java
ExampleController.java
FormDataController.java
example-servlet.xml

Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509342331211-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
--



3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAKKUxWeaAOKshRtDAp6yLxBEm_6ntcy8nSLdmNMh4t6Z55V0hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Nathan Keiter
In reply to this post by Saurabh Tripathi

There is a great example of how to use REST in OSGI here: https://github.com/wezell/com.dotcms.rest.page/blob/master/src/main/java/com/dotcms/plugin/rest/page/ContentWithRelationsResource.java Everything I’ve done with REST is based on Will’s plugin example.

 

Also, the source code of the built-in REST services gives good hints on how to use it.  You can see examples of POST, PUT, and GET here: https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L648

 

Finally, you could look at one of my example REST OSTI plugins: https://github.com/nkeiter/generic-dotCMS-plugin-code-examples/blob/master/dotcms4.1.1/osgi/org.example.nkeiter.contentlet.rest.light/src/main/java/org/example/nkeiter/contentlet/rest/light/service/ContentletRestServiceLight.java

 

Hope that helps.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Saurabh Tripathi
Sent: Monday, October 30, 2017 1:46 AM
To: [hidden email]
Subject: [dotcms] Re: Issue with enabling Spring Controller.

 

Thanks, Nathan,

As suggested by you, I have tried to add a simple RESTful-endpoint in dotCMS plugin framework, but I got the following WARNING messages:

30-Oct-2017 10:58:48.690 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime A provider com.dotmarketing.osgi.spring.FormDataController registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.dotmarketing.osgi.spring.FormDataController will be ignored.
DEBUG: Bundle com.dotcms.spring [11] jersey-multipart-config.properties not found by com.dotcms.spring [11]
30-Oct-2017 10:58:49.336 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.Errors.logErrors The following warnings have been detected: WARNING: A HTTP GET method, public com.dotcms.repackage.javax.ws.rs.core.Response com.dotcms.rest.elasticsearch.ESContentResourcePortlet.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String) throws com.dotmarketing.exception.DotDataException,com.dotmarketing.exception.DotSecurityException, should not consume any entity.
example-Servlet.xml read succefully.
Started bundle: jardir:E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-
INF\felix\load\com.dotcms.spring-0.1

Please find the files in the attachment.

Also, it will be helpful if you can provide some relevant code for a POST request with JSON response in the context with dotCMS.

Looking forward to your support.

Thanks.

build.gradle
Activator.java
ExampleController.java
FormDataController.java
example-servlet.xml


Sent from the dotCMS Users Group mailing list archive at Nabble.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509342331211-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/c7fe543476974aecbcef26648821c980%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Issue with enabling Spring Controller.

Jason Tesser
In reply to this post by Saurabh Tripathi
I can help with that. Please do not email me directly but email the goggle group. 



On Wed, Nov 1, 2017 at 12:36 AM <[hidden email]> wrote:
Thanks Jason for your support.

Basically, I wish to save a content from front-end using dotCMS REST endpoint but it requires the user to be authenticated to have permission to save data.
That's the pain point for me as I don't want to use user credentials on the front-end ajax call.

For the above-stated purpose, I want to enable a REST API endpoint for me where I just have to pass the content data with content type id and in the backend, it adds authentication credentials and hits the dotCMS REST endpoint for saving data from.

Is there any way to do so.

Currently, I have succeeded in enabling rest call as the following example illustrates:
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.spring
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.rest

_____________________________________
Sent from http://forumarchive.dotcms.com

--



3059 Grand Avenue
Suite 410-B
Miami FL 33133
Main: 
305-900-2001 | Direct: 978.294.9429

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAKKUxWe3MGQx5xtdCOGd%3DeTe50aQNebPpoSQMwdvQ3074MubAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: Issue with enabling Spring Controller.

Nathan Keiter
In reply to this post by Saurabh Tripathi
It's best to reply in the Google group.

Why not just create a save endpoint that doesn't require a log in? You don't need to do this in multiple steps.

In fact, you could just set up permissions to allow the anonymous user to edit the contentlets and avoid a plugin altogether.

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Wednesday, November 01, 2017 12:33 AM
To: Nathan Keiter
Subject: Re: Issue with enabling Spring Controller.

Thanks Nathan for your support.

Basically, I wish to save a content from front-end using dotCMS REST endpoint but it requires the user to be authenticated to have permission to save data.
That's the pain point for me as I don't want to use user credentials on the front-end ajax call.

For the above-stated purpose, I want to enable a REST API endpoint for me where I just have to pass the content data with content type id and in the backend, it adds authentication credentials and hits the dotCMS REST endpoint or the method associated with it for saving content data.

Is there any way to do so.

Currently, I have succeeded in enabling rest call as the following example illustrates:
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.spring
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.rest

_____________________________________
Sent from http://forumarchive.dotcms.com

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/2ea7a30ac03c43bdbe924406c8af5b48%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.