On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

Unable to deploy web application using WEM API to Weblogic or Tomcat.

We are using WEM 16.0 (Web Experience Management 16.0 SP1+Cumulative (2017-02-28 23:34:20 GMT)

We are writing a new web application that uses the WEM API to dynamically create Content Instances on the management stage.  We have the code working using the API but as a stand alone Java application, but we are having issues trying to deploy in a web application.

Our understanding is that we need to use the vgn-appsvsc-cma.jar instead of the vgn-appsvsc-cda.jar because we are creating new content.  This makes this web application different than a standard content delivery application which contains the vgn-appsvsc-cda.jar.  If someone could confirm this that would be great.

We have tried to deploy to both Weblogic and Tomcat, and each fail with different issues.

When deploying to Weblogic, we will get an EJB deployment error because of the vgn-appsvsc-cma.jar.  Apparently that jar contains EJBs and the CDI logic of the Weblogic JEE container scans the jars and attempts to dynamically deploy the EJBs.  Here is the error:

weblogic.application.ModuleException: In EJB 'WfEventHandler' we could not determine a principal-name to use for the run-as role 'VCMMDBUser'. The weblogic-ejb-jar deployment descriptor or corresponding annotation has no run-as-principal-name or run-as-identity-principal specified so an attempt was made to search the security-role-assignment corresponding to the role-name 'VCMMDBUser' with the intent of choosing a principal-name to use as the run-as principal-name but a principal-name corresponding to a user could not be found. You must specify a run-as-principal-name to use when running as the run-as role 'VCMMDBUser'.
                at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
                at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
                at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
                at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
                at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
                Truncated. see log file for complete stacktrace
Caused By: In EJB 'WfEventHandler' we could not determine a principal-name to use for the run-as role 'VCMMDBUser'. The weblogic-ejb-jar deployment descriptor or corresponding annotation has no run-as-principal-name or run-as-identity-principal specified so an attempt was made to search the security-role-assignment corresponding to the role-name 'VCMMDBUser' with the intent of choosing a principal-name to use as the run-as principal-name but a principal-name corresponding to a user could not be found. You must specify a run-as-principal-name to use when running as the run-as role 'VCMMDBUser'.
                at weblogic.ejb.container.deployer.RuntimeHelper.getRunAsPrincipalFromRoleMapping(RuntimeHelper.java:244)
                at weblogic.ejb.container.deployer.BeanInfoImpl.calculateRunAsPrincipal(BeanInfoImpl.java:837)
                at weblogic.ejb.container.deployer.BeanInfoImpl.prepare(BeanInfoImpl.java:779)
                at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.prepare(MessageDrivenBeanInfoImpl.java:1196)
                at weblogic.ejb.container.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:576)
                Truncated. see log file for complete stacktrace
>

 

When deploying to Tomcat, we ran into issues with wlfullclient.jar.  the vgn-appsvsc-cma.jar is dependent on the wlfullclient.jar.  First of all, it seems weird to be deploying a web app containing wlfullclient.jar to Tomcat, since wlfullclient.jar originates from Weblogic.  Here is the deployment error on Tomcat:

SEVERE: Error during ServletContainerInitializer processing
javax.servlet.ServletException: java.lang.NoSuchMethodException: org.glassfish.tyrus.server.TyrusServerConfiguration.<init>()
                at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:88)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5098)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
                at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1651)
                at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:287)
                at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
                at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1571)
                at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:294)
                at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:212)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
                at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:607)
                at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348)
                at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:52)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
                at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
                at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
                at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: org.glassfish.tyrus.server.TyrusServerConfiguration.<init>()
                at java.lang.Class.getConstructor0(Class.java:3082)
                at java.lang.Class.getConstructor(Class.java:1825)
                at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:75)
                ... 46 more

Class org.glassfish.tyrul.server.TyrusServerConfiguration exists in wlfullclient.jar which is why we believe it is related to this error.  I think this may be a classloader issue that could possibly be resolved, but we have not found the solution yet.

Can someone please help us get back on track here.  The Content Management SDK Developer Guide indicates that we should be able to use the API in a web application.  Since the cma jar is dependent on wlfullclient.jar, I am leaning toward trying to make work on Weblogic instead of Tomcat.  However, I am open to working solutions.