cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating resource via the api

Former Member
0 Kudos
52

I try to create a resource via the api with the following code:

aResource = aCollection.createResource(fileName, propMap, aContent)

The objects aCollection, fileName, propMap and aContent are all filled and valid.

As a result i always run in the following ResourceException

com.sapportals.wcm.repository.ResourceException: Cannot assign an empty string to host variable 6.

Let this message rings a bell by somebody??

We are on NW04 SPS17.

Regards,

Thomas

View Entire Topic
Former Member
0 Kudos

Stack trace?

Former Member
0 Kudos

[com.sapportals.wcm.repository.ResourceException.fillInStackTrace(ResourceException.java:399), java.lang.Throwable.<init>(Throwable.java:195), java.lang.Exception.<init>(Exception.java:41), com.sapportals.wcm.WcmException.<init>(WcmException.java:78), com.sapportals.wcm.util.content.ContentException.<init>(ContentException.java:50), com.sapportals.wcm.repository.ResourceException.<init>(ResourceException.java:215), com.sapportals.wcm.repository.manager.cm.CmNamespaceAndContentManager.createResource(CmNamespaceAndContentManager.java:729), com.sapportals.wcm.repository.manager.cm.CmNamespaceAndContentManager.createResource(CmNamespaceAndContentManager.java:562), com.sapportals.wcm.repository.CollectionImpl.internalCreateResource(CollectionImpl.java:1483), com.sapportals.wcm.repository.CollectionImpl.createResource(CollectionImpl.java:697), com.sapportals.wcm.repository.CollectionImpl.createResource(CollectionImpl.java:649), com.electrabel.eep.util.documentManagement.FileManager.createFile(FileManager.java:246), com.electrabel.eep.persistence.km.documentManagement.DocumentDAO.addAttachment(DocumentDAO.java:1111), com.electrabel.eep.persistence.SpeechesDAO.addDocument(SpeechesDAO.java:140), com.electrabel.eep.speeches.SpeechInput.doContent(SpeechInput.java:164), com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209), com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114), com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328), com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136), com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189), com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215), com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646), com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328), com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136), com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189), com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753), com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240), com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545), java.security.AccessController.doPrivileged(Native Method), com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405), javax.servlet.http.HttpServlet.service(HttpServlet.java:853), com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156), javax.servlet.http.HttpServlet.service(HttpServlet.java:853), com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390), com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264), com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347), com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325), com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887), com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241), com.sap.engine.services.httpserver.server.Client.handle(Client.java:92), com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148), com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33), com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41), com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37), java.security.AccessController.doPrivileged(Native Method), com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100), com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)]

Message was edited by:

Here the stacktrace from the underlying OpenSQLException:

com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 6.

at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)

at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)

at com.sap.sql.jdbc.common.dispatch.VarcharHostVariable.setString(VarcharHostVariable.java:26)

at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:591)

at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:341)

at com.sapportals.wcm.repository.manager.cm.persistence.BasicPersistenceDB.documentContentChanged(BasicPersistenceDB.java:2363)

at com.sapportals.wcm.repository.manager.cm.persistence.BasicPersistenceDB.documentContentChanged(BasicPersistenceDB.java:4773)

at com.sapportals.wcm.repository.manager.cm.persistence.BasicPersistenceDB.mountContent(BasicPersistenceDB.java:4794)

at com.sapportals.wcm.repository.manager.cm.CmNamespaceAndContentManager.createResource(CmNamespaceAndContentManager.java:676)

at com.sapportals.wcm.repository.manager.cm.CmNamespaceAndContentManager.createResource(CmNamespaceAndContentManager.java:562)

at com.sapportals.wcm.repository.CollectionImpl.internalCreateResource(CollectionImpl.java:1483)

at com.sapportals.wcm.repository.CollectionImpl.createResource(CollectionImpl.java:697)

at com.sapportals.wcm.repository.CollectionImpl.createResource(CollectionImpl.java:649)

at com.electrabel.eep.util.documentManagement.FileManager.createFile(FileManager.java:246)

at com.electrabel.eep.persistence.km.documentManagement.DocumentDAO.addAttachment(DocumentDAO.java:1115)

at com.electrabel.eep.persistence.SpeechesDAO.addDocument(SpeechesDAO.java:140)

at com.electrabel.eep.speeches.SpeechInput.doContent(SpeechInput.java:164)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

Thomas Kuri

Former Member
0 Kudos

Hi Thomas,

could you please check what your content argument returns as language:

((IEntityMetadata) aContent).getLanguage()

If this expression evaluates to an empty string, could you please try to make it <i>null</i> instead?

Best regards,

Michael

Message was edited by:

Michael Koeller