SAP-samples / cloud-sfsf-benefits-ext

SAP Employee Benefits Management is a sample extension application for SuccessFactors Employee Central. The application runs on SAP Cloud Platform and can be used by employees to make orders in specific benefits' campaigns and by HR managers to manage employee benefits and set up new benefits campaigns.
Apache License 2.0
39 stars 33 forks source link

PersistenceException #2

Closed 0xMitsara closed 10 years ago

0xMitsara commented 10 years ago

Upon deploying the application locally or a HCP the following error is thrown. Can you please help shine some light on the incident.

Thank you.

2014 03 22 23:55:50#0-400#INFO#System.out##anonymous#Thread-6####Updating file with path [C:\HANADev\Servers\SAP HANA Cloud Platform local runtime-config.\pickup\com.sap.hana.cloud.samples.benefits.war]| 2014 03 22 23:55:50#0-400#INFO#System.out##anonymous#Thread-6####Update of file with path [C:\HANADev\Servers\SAP HANA Cloud Platform local runtime-config.\pickup\com.sap.hana.cloud.samples.benefits.war] is successful.| 2014 03 22 23:55:50#0-400#ERROR#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/com.sap.hana.cloud.samples.benefits]##anonymous#Thread-6####Exception sending context initialized event to listener instance of class com.sap.hana.cloud.samples.benefits.service.AppServletContextListener javax.persistence.PersistenceException: No Persistence provider for EntityManager named com.sap.hana.cloud.samples.benefits at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89) at com.sap.hana.cloud.samples.benefits.persistence.manager.impl.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:30) at com.sap.hana.cloud.samples.benefits.persistence.manager.PersistenceManager.getInstance(PersistenceManager.java:21) at com.sap.hana.cloud.samples.benefits.service.AppServletContextListener.contextInitialized(AppServletContextListener.java:29) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125) at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:109) at org.eclipse.gemini.web.extender.WebContainerBundleCustomizer.addingBundle(WebContainerBundleCustomizer.java:49) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:482) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:262) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:234) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:457) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1523) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1459) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1454) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:291) at com.sap.core.js.deployer.watchservice.WARDeployer.update(WARDeployer.java:313) at com.sap.core.js.deployer.watchservice.FileSystemEventsListener.onChange(FileSystemEventsListener.java:51) at org.eclipse.virgo.util.io.FileSystemChecker.notifyListeners(FileSystemChecker.java:245) at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:166) at com.sap.core.js.deployer.watchservice.WatchTask.run(WatchTask.java:29) at java.lang.Thread.run(Unknown Source)| 2014 03 22 23:55:50#0-400#ERROR#org.apache.catalina.core.StandardContext##anonymous#Thread-6####Error listenerStart| 2014 03 22 23:55:50#0-400#ERROR#org.apache.catalina.core.StandardContext##anonymous#Thread-6####Context [/com.sap.hana.cloud.samples.benefits] startup failed due to previous errors|

Radenkov commented 10 years ago

Check where is persistence.xml file. It has to be located in the META-INF directory in the classpath. Also check that the persistence-unit name="com.sap.hana.cloud.samples.benefits".

0xMitsara commented 10 years ago

Both those suggestions seem to be in place. However when i print out the classloader using the following script

        ClassLoader cl = ClassLoader.getSystemClassLoader();
        URL[] urls = ((URLClassLoader)cl).getURLs();
        for(URL url: urls){

        System.out.println(url.getPath());
        }

i get the following ....../Servers/SAP%20HANA%20Cloud%20Platform%20local%20runtime-config/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar

All i did is as follows

Import project as maven Updated the environment variables (hard coded the values path to eclipse and ui5 version) Added the Dynamic Web Module Facet because it was missing and didn't allow me to be able to right click and Run on Server.

Nothing else was done to be able to deploy.

Thank you

Radenkov commented 10 years ago

Try to delete project and import it again as Existing Maven Project. You do not need to add Dynamic Web Module Facet.

0xMitsara commented 10 years ago

Hi, If i do not ad that facet the option of deploying using Run As > Run on Server is not available. Do you have a workaround for this?

Thank you

ghost commented 10 years ago

Hi,

If you clean fetch the app sources and import the project as “existing maven project”, eclipse maven plugin should import it as maven war project. So the facet will be preconfigured for you. Just make sure when you import the project, in the folder there is no “project” file and “settings” folder. I just fetch the project from github and import it- everything is fine.

Best Regards, Marin

From: jkalivas [mailto:notifications@github.com] Sent: Wednesday, March 26, 2014 11:20 PM To: SAP/cloud-sfsf-benefits-ext Subject: Re: [cloud-sfsf-benefits-ext] PersistenceException (#2)

Hi, If i do not ad that facet the option of deploying using Run As > Run on Server is not available. Do you have a workaround for this?

Thank you

— Reply to this email directly or view it on GitHubhttps://github.com/SAP/cloud-sfsf-benefits-ext/issues/2#issuecomment-38741304.

0xMitsara commented 10 years ago

I have tried this as well and still comes back with the same results. Would you be so kind to message me some contact information where i can communicate with one of the developers and see what's going on.

Thank you

ghost commented 10 years ago

I am the developer, and I suppose that the exception in the JPA is because your project is not imported correctly by the maven plugin. If your project import is successful, after you do a maven “update project”, everything should be fine. May be your maven plugin is not working.

[cid:image003.jpg@01CF4A67.BBFB9DF0]

In the above print screen are my maven plugins, eclipse IDE is KEPLER, the benefits app is imported as web project, and is working.

Regards, Marin

From: jkalivas [mailto:notifications@github.com] Sent: Thursday, March 27, 2014 6:51 PM To: SAP/cloud-sfsf-benefits-ext Cc: Hadzhiev, Marin Subject: Re: [cloud-sfsf-benefits-ext] PersistenceException (#2)

I have tried this as well and still comes back with the same results. Would you be so kind to message me some contact information where i can communicate with one of the developers and see what's going on.

Thank you

— Reply to this email directly or view it on GitHubhttps://github.com/SAP/cloud-sfsf-benefits-ext/issues/2#issuecomment-38829836.

0xMitsara commented 10 years ago

I would like to document the steps that i did to import the project so you can see exactly what happened. Can you please give me your email where i can send this?

Thank you.

ghost commented 10 years ago

Ok great. My email is marin.hadzhiev@sap.commailto:marin.hadzhiev@sap.com also add deyvid.radenkov@sap.commailto:deyvid.radenkov@sap.com because I am not sure that will have time to look into it in the next week. Deyvid is the developer assigned to your issue.

Regards, Marin

From: jkalivas [mailto:notifications@github.com] Sent: Friday, March 28, 2014 4:09 PM To: SAP/cloud-sfsf-benefits-ext Cc: Hadzhiev, Marin Subject: Re: [cloud-sfsf-benefits-ext] PersistenceException (#2)

I would like to document the steps that i did to import the project so you can see exactly what happened. Can you please give me your email where i can send this?

Thank you.

— Reply to this email directly or view it on GitHubhttps://github.com/SAP/cloud-sfsf-benefits-ext/issues/2#issuecomment-38922292.

maheshbasis5 commented 9 years ago

Hi when i run the application url https://benefitsp*********trial.hanatrial.ondemand.com/com.sap.hana.cloud.samples.benefits/index.html in the SAP HANA cloud portal it show below error please find the screen shot and log

snap 2015-03-16 at 17 43 13

log file:

ERROR#com.sap.hana.cloud.samples.benefits.odata.cfg.SimpleODataErrorCallback##P1694261187#http-bio-8041-exec-1#na#p1694261187trial#benefits#web#p1694261187trial#Error in the OData. Reason: An exception occurred.org.apache.olingo.odata2.api.edm.EdmException: An exception occurred.

at org.apache.olingo.odata2.core.edm.EdmImpl.getEntityContainer(EdmImpl.java:85)
at org.apache.olingo.odata2.core.edm.EdmImpl.getDefaultEntityContainer(EdmImpl.java:184)
at org.apache.olingo.odata2.core.uri.UriParserImpl.handleNormalInitialSegment(UriParserImpl.java:174)
at org.apache.olingo.odata2.core.uri.UriParserImpl.handleResourcePath(UriParserImpl.java:158)
at org.apache.olingo.odata2.core.uri.UriParserImpl.parse(UriParserImpl.java:112)
at org.apache.olingo.odata2.core.ODataRequestHandler.handle(ODataRequestHandler.java:107)
at org.apache.olingo.odata2.core.rest.ODataSubLocator.handle(ODataSubLocator.java:155)
at org.apache.olingo.odata2.core.rest.ODataSubLocator.handleGet(ODataSubLocator.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:271)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:214)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.core.communication.server.CertValidatorFilter.doFilter(CertValidatorFilter.java:151)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.hana.cloud.samples.benefits.odata.cfg.ODataContextFilter.doFilter(ODataContextFilter.java:21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.hana.cloud.samples.benefits.service.SessionCreateFilter.doFilter(SessionCreateFilter.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.hana.cloud.samples.benefits.service.ApplicationFilter.doFilter(ApplicationFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.hana.cloud.samples.benefits.service.EntityManagerInterceptor.doFilter(EntityManagerInterceptor.java:19)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sap.hana.cloud.samples.benefits.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.eclipse.virgo.web.enterprise.security.valve.OpenEjbSecurityInitializationValve.invoke(OpenEjbSecurityInitializationValve.java:44)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:612)
at com.sap.core.jpaas.security.auth.service.lib.AbstractAuthenticator.invoke(AbstractAuthenticator.java:205)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:215)
at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:94)
at com.sap.js.statistics.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:25)
at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:25)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:789)

Caused by: org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException: "OData - JPA Type Converter: Type [class java.util.Date] not supported" at org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException.throwException(ODataJPAModelException.java:87) at org.apache.olingo.odata2.jpa.processor.core.access.model.JPATypeConvertor.convertToEdmSimpleType(JPATypeConvertor.java:107) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmProperty$JPAEdmPropertyBuilder.buildSimpleProperty(JPAEdmProperty.java:337) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmProperty$JPAEdmPropertyBuilder.build(JPAEdmProperty.java:219) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntityType$JPAEdmEntityTypeBuilder.build(JPAEdmEntityType.java:128) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntitySet$JPAEdmEntitySetBuilder.build(JPAEdmEntitySet.java:89) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntityContainer$JPAEdmEntityContainerBuilder.build(JPAEdmEntityContainer.java:117) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmSchema$JPAEdmSchemaBuilder.build(JPAEdmSchema.java:119) at org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmModel$JPAEdmModelBuilder.build(JPAEdmModel.java:61) at org.apache.olingo.odata2.jpa.processor.core.edm.ODataJPAEdmProvider.getSchemas(ODataJPAEdmProvider.java:282) at org.apache.olingo.odata2.jpa.processor.core.edm.ODataJPAEdmProvider.getEntityContainerInfo(ODataJPAEdmProvider.java:92) at org.apache.olingo.odata2.core.edm.provider.EdmImplProv.createEntityContainer(EdmImplProv.java:59) at org.apache.olingo.odata2.core.edm.EdmImpl.getEntityContainer(EdmImpl.java:69) ... 73 common frames omitted

Regards Mahesh

takvort commented 9 years ago

Hi Mahesh,

Have you done any changes on the application project from github - I've fetched (from master), built and deployed the application on a trial account and it works as expected - the destination (sap_hcmcloud_core_odata) that I have defined on application level points to https://sfsfbizxtrial.hana.ondemand.com/odata/v2.

Kind regards, Taki

maheshbasis5 commented 9 years ago

Hi Taki,

Thanks for your response ,I've added dependencies versions and extra dependencies

Regards Mahesh

takvort commented 9 years ago

Can you attach your modified pom.xml (or any other changes you've made)

maheshbasis5 commented 9 years ago

Attached modified pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

4.0.0
<groupId>com.sap.hana.clould.samples.benefits</groupId>
<artifactId>com.sap.hana.cloud.samples.benefits</artifactId>
<version>2.2.0</version>
<packaging>war</packaging>
<name>SAP Employee Benefits Management Sample Application</name>
<description>The SAP HANA Cloud Platform extension package makes it quick and easy for companies to adapt and integrate SuccessFactors cloud applications to their existing business processes.</description>
<url>https://github.com/SAP/cloud-sfsf-benefits-ext</url>

<organization>
    <name>SAP AG</name>
    <url>http://www.sap.com</url>
</organization>

<developers>
    <developer>
        <name>SAP HANA Cloud</name>
        <email>netweaver-cloud@sap.com</email>
        <url>http://hana.ondemand.com</url>
        <organization>SAP AG</organization>
        <organizationUrl>http://www.sap.com/</organizationUrl>
    </developer>
</developers>

<licenses>
    <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
    </license>
</licenses>

<properties>
    <sap.cloud.jdk.version>1.7</sap.cloud.jdk.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- <apache.cxf.version>2.7.13</apache.cxf.version> -->
    <!-- <olingo.version>2.0.1</olingo.version> -->
</properties>

<repositories>
    <repository>
        <id>java.net2</id>
        <name>Repository hosting the jee6 artifacts</name>
        <url>http://download.java.net/maven/2</url>
    </repository>
    <repository>
        <id>maven.repo</id>
        <name>Maven central Repository</name>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
    <repository>
        <id>oss.sonatype.org</id>
        <name>OSS Sonatype Staging</name>
        <url>https://oss.sonatype.org/content/groups/staging</url>
    </repository>
    <repository>
        <id>repo.apache.org</id>
        <name>Apache Snapshots Repository</name>
        <url>https://repository.apache.org/content/groups/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.5.2</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>

    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.7</version>
    </dependency>

    <!-- <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
        <version>${apache.cxf.version}</version> </dependency> -->
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        <version>3.0.3</version>
    </dependency>

    <!-- <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> 
        <version>2.2.2</version> </dependency> -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.4</version>
    </dependency>

    <dependency>
        <groupId>com.sap.cloud</groupId>
        <artifactId>neo-java-web-api</artifactId>
        <version>1.43.20.3</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2.4</version>
        <scope>provided</scope>
    </dependency>

    <!-- <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> 
        <version>4.2.4</version> <scope>provided</scope> </dependency> -->

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.3.2</version>
    </dependency>

    <dependency>
    <groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-api</artifactId>
<version>2.0.0</version>

org.apache.olingo olingo-odata2-jpa-processor-api-incubating 1.0.0
<dependency>
<groupId>org.apache.olingo</groupId>
        <artifactId>olingo-odata2-jpa-processor-core</artifactId>
        <version>2.0.0</version>
    </dependency>

    <!-- <dependency> <groupId>org.apache.olingo</groupId> <artifactId>olingo-odata2-jpa-processor-core</artifactId> 
        <version>${olingo.version}</version> </dependency>-->
    </dependencies> 

    <build>
        <sourceDirectory>${project.basedir}/src</sourceDirectory>
        <testSourceDirectory>${project.basedir}/test</testSourceDirectory>
        <outputDirectory>${project.basedir}/war/WEB-INF/classes</outputDirectory>
        <testOutputDirectory>${project.basedir}/bin/classes</testOutputDirectory>
        <resources>
            <resource>
                <directory>${project.basedir}/src</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>${project.basedir}/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${project.basedir}/test</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <warName>${project.artifactId}</warName>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                    <webXml>WebContent\WEB-INF\web.xml</webXml>
                    <archive>
                        <manifestFile>WebContent/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>${sap.cloud.jdk.version}</source>
                    <target>${sap.cloud.jdk.version}</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
        </plugins>
    </build>

takvort commented 9 years ago

Hi Mahesh,

It seems that the version of Olingo that you are using

    <dependency>
        <groupId>org.apache.olingo</groupId>
        <artifactId>olingo-odata2-jpa-processor-core</artifactId>
        <version>2.0.0</version>
    </dependency>

does not support java.util.Date – see https://issues.apache.org/jira/browse/OLINGO-293

If you go with the original versions of the application dependencies (olingo - 2.0.1) you won’t have a problem – seems java.util.Date is supported in this version.

Two more thing I’ve notices in your pom

BTW, you can run the application on a local HCP server for faster debugging – just provide the sap_hcmcloud_core_odata destination in the local server under /Servers/Java Web Server-config/config_master/service.destinations/destinations/ - create a "sap_hcmcloud_core_odata" file with the following content:

Description=SuccessFactors Core OData API Type=HTTP TrustAll=true Authentication=BasicAuthentication Name=sap_hcmcloud_core_odata CloudConnectorVersion=1 ProxyType=Internet URL=https://sfsfbizxtrial.hana.ondemand.com/odata/v2 User=[user] Password=[pass]

Kind regards, Taki

maheshbasis5 commented 9 years ago

HI Taki,

Application is working ... Thanks Taki

Regards Mahesh

maheshbasis5 commented 9 years ago

HI, I am getting below error when run the application 11:59:31#+00#ERROR#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/com.sap.hana.cloud.samples.benefits]##anonymous#fs-watcher#na#s0011747290trial#benefits#web##Exception sending context initialized event to listener instance of class com.sap.hana.cloud.samples.benefits.service.AppServletContextListenerjavax.persistence.RollbackException: Exception [EclipseLink-4002](Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [274]: inserted value too large for column: Amazon.com Gift Cards are redeemable for millions of items storewide, have no fees, and never expire. Error Code: 274 Call: INSERT INTO BENEFITS_INFO (BENEFIT_INFO_ID, DESCRIPTION, LINK, NAME) VALUES (?, ?, ?, ?) bind => [4 parameters bound] Query: InsertObjectQuery(com.sap.hana.cloud.samples.benefits.persistence.model.BenefitInfo@27709034) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:157) at com.sap.hana.cloud.samples.benefits.persistence.BasicDAO.saveNew(BasicDAO.java:54) at com.sap.hana.cloud.samples.benefits.persistence.BenefitDAO.save(BenefitDAO.java:29) at com.sap.hana.cloud.samples.benefits.csv.dataimport.BenefitsDataImporter.persistBenefitsInfo(BenefitsDataImporter.java:65) at com.sap.hana.cloud.samples.benefits.csv.dataimport.BenefitsDataImporter.importDataFromCSV(BenefitsDataImporter.java:27) at com.sap.hana.cloud.samples.benefits.service.AppServletContextListener.initBenefits(AppServletContextListener.java:41) at com.sap.hana.cloud.samples.benefits.service.AppServletContextListener.contextInitialized(AppServletContextListener.java:30) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125) at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:109) at org.eclipse.gemini.web.extender.WebContainerBundleCustomizer.addingBundle(WebContainerBundleCustomizer.java:49) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1568) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1504) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1499) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292) at org.eclipse.virgo.web.war.deployer.WARDeployer.start(WARDeployer.java:780) at org.eclipse.virgo.nano.deployer.internal.StandardApplicationDeployer.startDeployables(StandardApplicationDeployer.java:324) at org.eclipse.virgo.nano.deployer.internal.StandardApplicationDeployer.bulkDeploy(StandardApplicationDeployer.java:115) at org.eclipse.virgo.nano.deployer.hot.HotDeploymentFileSystemListener.bulkDeployIfNotDeployed(HotDeployerFileSystemListener.java:143) at org.eclipse.virgo.nano.deployer.hot.HotDeploymentFileSystemListener.onInitialEvent(HotDeployerFileSystemListener.java:105) at org.eclipse.virgo.util.io.FileSystemChecker.notifyListenersOnInitialEvent(FileSystemChecker.java:207) at org.eclipse.virgo.util.io.FileSystemChecker.handleInitialFiles(FileSystemChecker.java:177) at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:261) at org.eclipse.virgo.nano.deployer.hot.WatchTask.run(WatchTask.java:48) at java.lang.Thread.run(Thread.java:812) Caused by: org.eclipse.persistence.exceptions.DatabaseException: Internal Exception: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [274]: inserted value too large for column: Amazon.com Gift Cards are redeemable for millions of items storewide, have no fees, and never expire. Error Code: 274 Call: INSERT INTO BENEFITS_INFO (BENEFIT_INFO_ID, DESCRIPTION, LINK, NAME) VALUES (?, ?, ?, ?) bind => [4 parameters bound] Query: InsertObjectQuery(com.sap.hana.cloud.samples.benefits.persistence.model.BenefitInfo@27709034) at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:962) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:631) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1991) at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:298) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:377) at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:165) at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:180) at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:489) at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80) at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90) at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301) at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899) at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:798) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1793) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1775) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1726) at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:226) at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsForClassWithChangeSet(CommitManager.java:193) at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:138) at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4196) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:277) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:132) ... 39 common frames omitted Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [274]: inserted value too large for column: Amazon.com Gift Cards are redeemable for millions of items storewide, have no fees, and never expire. at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:345) at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:185) at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:100) at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:1130) at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:877) at com.sap.db.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:410) at com.sap.db.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:266) at com.sap.db.jdbc.CallableStatementSapDB.executeUpdate(CallableStatementSapDB.java:791) at com.sap.db.jdbc.trace.PreparedStatement.executeUpdate(PreparedStatement.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.sap.core.persistence.jdbc.trace.TraceableBase$1.invoke(TraceableBase.java:44) at com.sun.proxy.$Proxy44.executeUpdate(Unknown Source) at com.sap.core.persistence.jdbc.trace.TraceablePreparedStatement.executeUpdate(TraceablePreparedStatement.java:88) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:890) ... 71 common frames omitted | 2015 04 24 11:59:32#+00#ERROR#org.apache.catalina.core.StandardContext##anonymous#fs-watcher#na#s0011747290trial#benefits#web##Error listenerStart| 2015 04 24 11:59:32#+00#ERROR#org.apache.catalina.core.StandardContext##anonymous#fs-watcher#na#s0011747290trial#benefits#web##Context [/com.sap.hana.cloud.samples.benefits] startup failed due to previous errors| 2015 04 24 11:59:32#+00#ERROR#org.eclipse.gemini.web.internal.StandardWebApplication##anonymous#fs-watcher#na#s0011747290trial#benefits#web##Failed to start web application at context path '/com.sap.hana.cloud.samples.benefits'org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/com.sap.hana.cloud.samples.benefits' failed to start. Check the logs for more details. at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:133) at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:109) at org.eclipse.gemini.web.extender.WebContainerBundleCustomizer.addingBundle(WebContainerBundleCustomizer.java:49) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467) at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1568) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1504) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1499) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292) at org.eclipse.virgo.web.war.deployer.WARDeployer.start(WARDeployer.java:780) at org.eclipse.virgo.nano.deployer.internal.StandardApplicationDeployer.startDeployables(StandardApplicationDeployer.java:324) at org.eclipse.virgo.nano.deployer.internal.StandardApplicationDeployer.bulkDeploy(StandardApplicationDeployer.java:115) at org.eclipse.virgo.nano.deployer.hot.HotDeploymentFileSystemListener.bulkDeployIfNotDeployed(HotDeployerFileSystemListener.java:143) at org.eclipse.virgo.nano.deployer.hot.HotDeploymentFileSystemListener.onInitialEvent(HotDeployerFileSystemListener.java:105) at org.eclipse.virgo.util.io.FileSystemChecker.notifyListenersOnInitialEvent(FileSystemChecker.java:207) at org.eclipse.virgo.util.io.FileSystemChecker.handleInitialFiles(FileSystemChecker.java:177) at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:261) at org.eclipse.virgo.nano.deployer.hot.WatchTask.run(WatchTask.java:48) at java.lang.Thread.run(Thread.java:812)

Regards Mahesh

takvort commented 9 years ago

Hi Mahesh,

Are you using different version of eclipse.link than the one in the pom.xml?

The following post:

http://scn.sap.com/thread/3202085

explains that eclipselink creates VARCHAR(1) for String fields, and there are a few workaround for this.

Kind regards, Taki

takvort commented 9 years ago

You can also google "SAP DBTech JDBC: [274]" for more solutions

maheshbasis5 commented 9 years ago

Hi Taki,

Application was working, I followed below steps

  1. go the cockpit -> Your application -> Database Schemas and delete the schema of the application. 2.Changed Eclipse link version to 2.5.2.
  2. deploy/run the application again Thank you ... Regards Mahesh