• Shoby Abdi.ax1151
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

I've been running through the following Database.com Java SDK quickstart

 

http://forcedotcom.github.com/java-sdk/quick-start <-- The Hello Cloud example

 

To extend the application, I generated a POJO for the Task object, which is basically the following

 

package org.docsample.model;

import javax.persistence.*;
import com.force.sdk.*;

@javax.annotation.Generated(value="com.force.sdk.codegen.ForceJPAClassGenerator")
@Table(name="Task")
@Entity(name="Task")
@com.force.sdk.jpa.annotation.CustomObject(readOnlySchema=true)
public class Task extends com.force.sdk.jpa.model.BaseForceObject {

    public static final String KEY_PREFIX = "00T";


    // whoId possible references:
    // Contact
    // Lead
    protected String whoId;
    // whatId possible references:
    // Account
    // Asset
    // Campaign
    // Case
    // Contract
    // Opportunity
    // Product2
    // Solution
    protected String whatId;
    protected boolean subject;
    protected java.util.Date activityDate;
    protected String status;
    protected String priority;
    //protected User owner;
    protected String description;
    protected boolean isDeleted;
    //protected Account account;
    protected boolean isClosed;
    protected java.util.Calendar createdDate;
    //protected User createdBy;
    protected java.util.Calendar lastModifiedDate;
    //protected User lastModifiedBy;
    protected java.util.Calendar systemModstamp;
    protected boolean isArchived;
    protected int callDurationInSeconds;
    protected CallTypeEnum callType;
    protected String callDisposition;
    protected String callObject;
    protected java.util.Calendar reminderDateTime;
    protected boolean isReminderSet;
    protected Task recurrenceActivityId;
    protected boolean isRecurrence;
    protected java.util.Date recurrenceStartDateOnly;
    protected java.util.Date recurrenceEndDateOnly;
    protected RecurrenceTimeZoneSidKeyEnum recurrenceTimeZoneSidKey;
    protected RecurrenceTypeEnum recurrenceType;
    protected int recurrenceInterval;
    protected int recurrenceDayOfWeekMask;
    protected int recurrenceDayOfMonth;
    protected RecurrenceInstanceEnum recurrenceInstance;
    protected RecurrenceMonthOfYearEnum recurrenceMonthOfYear;
    
...

}

 I am currently trying to add this object, but its not uploading properly. I get the following exception:

 

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.docsample.service.EntityService org.docsample.controller.EntityController.entityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [app-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Explicit persistence provider error(s) occurred for "forceDatabase" after trying the following discovered implementations: org.datanucleus.jpa.PersistenceProviderImpl, com.force.sdk.jpa.PersistenceProviderImpl from provider: com.force.sdk.jpa.PersistenceProviderImpl
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
When I take off the following annotation from the entity
@Entity(name="Task")

@Table(name="Task")

It generates a custom object, but with it I get the exceptions above. I can't see the correlation between setting up a standard object in the JPA and BeanGeneration not working. 

 

The settings on the hellocloud app are exactly the same as the demo. The app is working, its just when I add the Task POJO to the Model Bean generation fails. Am I missing a setting somewhere?

Built a controller and an visualforce page. Trying to gather records from an object and then use <apex:repeat> to display them on the page. Here's the controller code:

 

public class MyCustomRentalExtension {
	
	//The standard controller on which this extension is based
	Custom_Rental__c rental;
	
	//Properties of this class
	public String booth {get;set;}
	List<Custom_Rental__c> allSizes = new List<Custom_Rental__c>();
	
	//Constructor
	public MyCustomRentalExtension() {
		//set the default size
		booth = '10x10';
		
		//on page load, get the size param from the URL 
		String sizeParam = ApexPages.currentPage().getParameters().get('booth');
		if (sizeParam != ''){
			for (Custom_Rental__c cr : allSizes){
				if(cr.Booth__c == sizeParam){
					booth = cr.Booth__c;
				}
			}
		}
	}
	
	
	//List records for a specific booth size
	public List<Custom_Rental__c> getBooths() {
		return [Select p.id, p.File_Name__c, p.Preview_Link__c from Custom_Rental__c p where p.Booth__c = :booth Order By p.File_Name__c];
	}
}

Here is the VF Page:

<apex:page showHeader="false" id="body" standardStylesheets="false" controller="MyCustomRentalExtension" cache="true" expires="600">
<head>
<title>{!booth} Customer Rental Extension Site</title></head>

<h2> {!booth} Custom Rental Portfolio</h2><br/>
<p>To learn more about our {!booth} custom rental solutions click on one of the booth photographs below.</p><br/>

<apex:form id="form">
	<apex:outputPanel id="list">
		<apex:repeat value="{!Booths}" var="booth" id="boothList">
			<div style="float: left; padding:0; margin:0px 15px 15px 0px;">
				<h4 align="center">{!booth.File_Name__c}</h4>
				<div style="border: 2px solid #e2e2e2; margin:0; padding:2px;">
					<a href="Page1?id={booth.id}">
						<img src="{!booth.Preview_Link__c}" width="250" height="200" alt="{!booth.Name}" />
						</a>
						</div>
					</div>
				</apex:repeat>
			</apex:outputPanel>
		</apex:form>

</apex:page>

 

 I am getting an error on the VF page saying "Unknown Property 'String.File_Name__c'

I've been running through the following Database.com Java SDK quickstart

 

http://forcedotcom.github.com/java-sdk/quick-start <-- The Hello Cloud example

 

To extend the application, I generated a POJO for the Task object, which is basically the following

 

package org.docsample.model;

import javax.persistence.*;
import com.force.sdk.*;

@javax.annotation.Generated(value="com.force.sdk.codegen.ForceJPAClassGenerator")
@Table(name="Task")
@Entity(name="Task")
@com.force.sdk.jpa.annotation.CustomObject(readOnlySchema=true)
public class Task extends com.force.sdk.jpa.model.BaseForceObject {

    public static final String KEY_PREFIX = "00T";


    // whoId possible references:
    // Contact
    // Lead
    protected String whoId;
    // whatId possible references:
    // Account
    // Asset
    // Campaign
    // Case
    // Contract
    // Opportunity
    // Product2
    // Solution
    protected String whatId;
    protected boolean subject;
    protected java.util.Date activityDate;
    protected String status;
    protected String priority;
    //protected User owner;
    protected String description;
    protected boolean isDeleted;
    //protected Account account;
    protected boolean isClosed;
    protected java.util.Calendar createdDate;
    //protected User createdBy;
    protected java.util.Calendar lastModifiedDate;
    //protected User lastModifiedBy;
    protected java.util.Calendar systemModstamp;
    protected boolean isArchived;
    protected int callDurationInSeconds;
    protected CallTypeEnum callType;
    protected String callDisposition;
    protected String callObject;
    protected java.util.Calendar reminderDateTime;
    protected boolean isReminderSet;
    protected Task recurrenceActivityId;
    protected boolean isRecurrence;
    protected java.util.Date recurrenceStartDateOnly;
    protected java.util.Date recurrenceEndDateOnly;
    protected RecurrenceTimeZoneSidKeyEnum recurrenceTimeZoneSidKey;
    protected RecurrenceTypeEnum recurrenceType;
    protected int recurrenceInterval;
    protected int recurrenceDayOfWeekMask;
    protected int recurrenceDayOfMonth;
    protected RecurrenceInstanceEnum recurrenceInstance;
    protected RecurrenceMonthOfYearEnum recurrenceMonthOfYear;
    
...

}

 I am currently trying to add this object, but its not uploading properly. I get the following exception:

 

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.docsample.service.EntityService org.docsample.controller.EntityController.entityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [app-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Explicit persistence provider error(s) occurred for "forceDatabase" after trying the following discovered implementations: org.datanucleus.jpa.PersistenceProviderImpl, com.force.sdk.jpa.PersistenceProviderImpl from provider: com.force.sdk.jpa.PersistenceProviderImpl
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
When I take off the following annotation from the entity
@Entity(name="Task")

@Table(name="Task")

It generates a custom object, but with it I get the exceptions above. I can't see the correlation between setting up a standard object in the JPA and BeanGeneration not working. 

 

The settings on the hellocloud app are exactly the same as the demo. The app is working, its just when I add the Task POJO to the Model Bean generation fails. Am I missing a setting somewhere?