Hello
I have a problem with sculptor's importing mechanism.
I try to make a make multiple projects using archetypes from pure EJB3 tutorial:
helloworld-parenthelloworld
helloworld-ear
Model contains just one entity, repository, resource, and service. And it works just fine.
Then I add
helloworld-shared project with next structure:
helloworld-shared/src/main/resources
model-shared.btdesign:
ApplicationPart MyApp {
Module shared_model {
basePackage=org.helloworld
Entity Employee {
String name
Repository EmployeeRepository {
findById;
findAll;
save;
delete;
}
}
model.btdesign: //doesn't build without this file
import "classpath:/model-shared.btdesign"
Application MyApp {
basePackage=org.helloworld
}
And in business tier project I just have
import "classpath:/model-shared.btdesign"
Application MyApp {
basePackage=org.helloworld
Module test1 {
Service EmployeeService {
findById => EmployeeRepository.findById;
findAll => EmployeeRepository.findAll;
save => EmployeeRepository.save;
delete => EmployeeRepository.delete;
}
Resource EmployeeResource {
show => EmployeeService.findById;
showAll => EmployeeService.findAll;
create => EmployeeService.save;
delete => EmployeeService.delete;
update => EmployeeService.save;
}
Resource HelloWorldResource {
void hello;
}
}
}
I also add needed dependencies in pom.xml for business tier project. Everything according to Advanced tutorial. Plus disabling generation for the shared part in
sculptor-generator.properties.After that I have two problems. Sculptor cannot find shared model on classpath when building parent project.
[ERROR] Failed to execute goal org.sculptorgenerator:sculptor-maven-plugin:3.1.0:generate (code-generation) on project helloworld: Execution code-generation of goal org.sculptorgenerator:sculptor-maven-plugin:3.1.0:generate failed: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/model-shared.btdesign' -> [Help 1]
This issue doesn't happen when I build business tier project separately. But in this case tests begin to fali:
Tests in error:
testFindAll(org.helloworld.test1.serviceapi.EmployeeServiceTest): Name "MessagingTestBean" not found.
testSave(org.helloworld.test1.serviceapi.EmployeeServiceTest): Name "MessagingTestBean" not found.
testFindById(org.helloworld.test1.serviceapi.EmployeeServiceTest): Name "MessagingTestBean" not found.
testDelete(org.helloworld.test1.serviceapi.EmployeeServiceTest): Name "MessagingTestBean" not found.
testDelete(org.helloworld.test1.serviceapi.EmployeeServiceTest) Time elapsed: 0 sec <<< ERROR!
javax.naming.NameNotFoundException: Name "MessagingTestBean" not found.
Can you tell me what can possibly lead to these errors? Maybe some general directions to look into.
Thank you