My OS is centos (linux senleft-ws 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux)
The VM start log is here http://pastebin.com/XqhUWkA1
Could somebody give me advice how to fix it?
Thank you!
Thank you very much!
May be it need to paraphrase statement "This is a rule in JPA: if @Id is on a field, the JPA provider will access fields of the class directly" as current JPA spec version tell nothing about this (or may be I couldn't find it).
I have seen the @Embeddable classes Address and City example. And this is not I’m talking about.
This is example with one level nested @Embeddable class City.
I’m talking about two level nested example like next.
I make a little refactoring for example in org.jpwh.model.collections.bagofembeddables
I added the second level @Embeddable class ImageMetadata to class Image instead of sizeX, sizeY fields (without accessors to this fields).
In spite of consistent placement of annotations above fields Hibernate can’t make mapping for ImageMetadata class.
https://dl.dropboxusercontent.com/u/8384811/Misc/embeddable.jpg
However if you will place @Access(AccessType.FIELD) annotation to ImageMetada it solves this issue.

So consistent placement of annotations above fields do not guarantee Hibernate access to fields of the second level @Embeddable class ImageMetadata.

Could you check it please and say me if I wrong in my previous statement.

Below is the source code of example
@Embeddable
public class Image {

@Column(nullable = true) // Can be null if we have surrogate PK!
protected String title;

@Column(nullable = false)
protected String filename;

protected ImageMetadata imageMetadata;

public Image() { }

public Image(String title, String filename, int sizeX, int sizeY) {
this.title = title;
this.filename = filename;
imageMetadata = new ImageMetadata(sizeX, sizeY);
}
}
@Entity
public class Item {

@Id
@GeneratedValue(generator = Constants.ID_GENERATOR)
protected Long id;

@ElementCollection
@CollectionTable(name = "IMAGE")
@org.hibernate.annotations.CollectionId(
columns = @Column(name = "IMAGE_ID"),
type = @org.hibernate.annotations.Type(type = "long"),
generator = Constants.ID_GENERATOR)
protected Collection<Image> images = new ArrayList<Image>();

public Long getId() {
return id;
}

public Collection<Image> getImages() {
return images;
}

// ...
}
@Embeddable
public class ImageMetadata {

protected int sizeX;
protected int sizeY;

public ImageMetadata() {}

public ImageMetadata(int sizeX, int sizeY) {
this.sizeX = sizeX;
this.sizeY = sizeY;
}
}
From item 3.2.1 I knew that "This is a rule in JPA: if @Id is on a field, the JPA provider will access fields of the class directly".

I can't find this rule in JPA spec. According to JPA specification


2.3.1 Default Access Type


By default, a single access type (field or property access) applies to an entity hierarchy. The default access type of an entity hierarchy is determined by the placement of mapping annotations on the attributes of the entity classes and mapped superclasses of the entity hierarchy that do not explicitly specify an access type. An access type is explicitly specified by means of the Access annotation [6], as described in section 2.3.2



More over, I think the default access (FIELD - with mapping placement above the field) will not work for the nesting @Embeddable classes (more than one), if you using the Hibernate. For the proper mapping you need to explicitly specify the access type FIELD on @Embeddable classes. It's slightly different from JPA spec.


Am I right or wrong about default access implementation for the nesting @Embeddable classes (more than one) in the Hibernate ?


I have posted question and code examples on the SOF (http://stackoverflow.com/questions/18441222/issue-with-jpa-mapping-for-two-nested-embeddable), but still don't get any answers.

Message was edited by:
senleft
I try to run mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true several times, and it downladed all dependencies. Then I run:
>mvn eclipse:clean
>mvn eclipse:eclipse

However, I still not have org.bpmnwithactiviti.chapter7.ws package.

This is log mvn eclipse:eclipse http://pastebin.com/Gxpj1NJk
Thank you very much Tijs, I have solved this issue. It's my mistake. I used IDEA, and project was generated based on POM but not from generated Eclipse files. So resulting CLASSPATH has not generated/cxf folder. Issue was solved after adding it to src in Project Settings.
Chapter 7 example - StoreOpportunityTask - used the Customer, CustomerServiceService, SalesOpportunity classes from org.bpmnwithactiviti.chapter7.ws package.
However, there is no that package in the ActivitiInAction sourcecode. May ask you to check it?
Thank you for the quick answer!
I try to run Maven CXF plugin. You may see a result at http://pastebin.com/Sh2TYw3w
It seems like maven try to download asm-3.1 dependency and fail to do it. It may be due to a broken link. I have no idea how to solve it. Furthermore, I can't find that dependency in the project POM file.
Yes, I have sources. I'm running mvn eclipse:eclipse (http://pastebin.com/Gxpj1NJk ) from bpmn-examples folder.
You may see result mvn clean install (bpmn-examples folder too) on the next link http://dl.dropbox.com/u/8384811/mvn_clean_install_log.zip
Yes, I have use Activiti 5.8.
I added the next dependency and error was solved.

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.8.3</version>
</dependency>

However there is no the groovy dependency in the "Listing 4.1 A standard Maven configuration for an Activiti project". May be you should add it to Activiti project POM example.
Thank you very much for your help.
I try to run the test from listing 1.4 and get the next output:
----------------------------
26.01.2012 20:37:31 org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
26.01.2012 20:37:31 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource bookorder.simple.bpmn20.xml
26.01.2012 20:37:32 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
26.01.2012 20:37:32 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
id913 simplebookorder:6:912

junit.framework.AssertionFailedError:
Expected :1
Actual : 0
----------------------------
The H2 database is running
The problem is that taskService return nothing in the next call

List<Task> taskList = taskService.createTaskQuery()
.taskCandidateUser("kermit")
.list();

so assertion
assertEquals(1, taskList.size());
is failed

You can find my project files on http://bit.ly/wTEfun

I'll appreciate you for any help!
Thank you! I have corrected this error, however I got the new error :
org.activiti.engine.ActivitiException: Can't find scripting engine for 'groovy'

Full stack trace
http://pastebin.com/8SEE7bWz

I decided to use the original source code and got the same error too.
Page 10
XML code snippet
<process id="simplebookorder" name="Order book">
---------------
Page 11 Java code snippet
ProcessInstance processInstance = #3
runtimeService.startProcessInstanceByKey( #3
"simplebookorder"); #3
---------------
Page 12
The key bookorder, which is passed as process key parameter, should be equal to the process id attribute from the book order process of code listing 1.1.
---------------
Page 14
identityService.setAuthenticatedUserId("kermit"); #A
ProcessInstance processInstance = #2
runtimeService.startProcessInstanceByKey( #2
"bookorder", variableMap); #2
---------------
I think the key should have the simplebookorder value.
page 2
------------
Activiti is funded by Alfresco (known for its open source document management system
Alfresco, see http://www.alfresco.com and chapter 12 for more details).
------------
Chapter 13 - Document management using Alfresco
Page 14
List<Task> taskList = taskService.createTaskQuery() #B
.taskCandidateUser("kermit") #B
.list() #B
assertEquals(taskList.size(), 1);
System.out.println("found task " +
taskList.get(0).getName());
---------------------
1. I think it is need to add the semicolon at the end of line ".list()"
2. May be you should swap arguments in the " assertEquals(taskList.size(), 1)" method call. Because the 1st arg is expected value and the 2nd arg is the actual value.