2017-11-06 11 views
2

은 내가 예상대로 잘하고 모든 작업을 실행 IDE에서 실행하면 내 직원이아파치 이시스 내 엔티티의 속성으로 ApplicationUser에서 사용하는 사용자가

import org.isisaddons.module.security.dom.role.ApplicationRole; 
import org.isisaddons.module.security.dom.user.ApplicationUser; 
import org.isisaddons.module.security.dom.user.ApplicationUserRepository; 

@Column(allowsNull = "true") 
@Property(editing = Editing.ENABLED) 
@Getter @Setter 
private ApplicationUser user; 

public List<ApplicationUser> choicesUser() { 
    return applicationUserRepository.allUsers(); 
} 

public List<ApplicationRole> getUserRoles() { 
    return user!=null? Lists.newArrayList(user.getRoles()):Lists.newArrayList(); 
} 

@Action() 
public Employee createUser(
     @ParameterLayout(named = "Username") final String username, 
     @ParameterLayout(named = "Password") final Password password, 
     @ParameterLayout(named = "Repeat Password") final Password repeatPassword, 
     final ApplicationRole initialRole, 
     final Boolean enable, 
     final String emailAddress) { 
    ApplicationUser applicationUser = applicationUserRepository.newLocalUser(username, password, repeatPassword, initialRole, enable, emailAddress); 
    this.setUser(applicationUser); 
    return this; 
} 

울부 짖는 소리로 사용자가 원할 때 실패를 알 수없는 저장소를 지정 구축하지만, mvn clean install을 실행합니다. 위의 코드를 제거하면 오류가 발생합니다. 제가 놓친 다른 것이 있습니까?

[INFO] calling @PostConstruct on all domain services 
[WARNING] NOT configured 
[ERROR] 
[ERROR] 
[ERROR] 
[ERROR] @DomainObject annotation on org.isisaddons.module.security.dom.role.ApplicationRole specifies unknown repository 'org.isisaddons.module.security.dom.role.ApplicationRoleRepository' 
[ERROR] @DomainObject annotation on org.isisaddons.module.security.dom.user.ApplicationUser specifies unknown repository 'org.isisaddons.module.security.dom.user.ApplicationUserRepository' 
[ERROR] 
[ERROR] 
[ERROR] 
[INFO] calling @PreDestroy on all domain services 
[INFO] shutting down [email protected]041bad 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Summary: 
[INFO] 
[INFO] Incode QuickStart .................................. SUCCESS [ 0.279 s] 
[INFO] Incode QuickStart Base Module ...................... SUCCESS [ 2.480 s] 
[INFO] Employment Module .................................. FAILURE [ 11.695 s] 
[INFO] Incode QuickStart App Definition ................... SKIPPED 
[INFO] Incode QuickStart Webapp ........................... SKIPPED 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 15.022 s 
[INFO] Finished at: 2017-11-06T11:09:35+07:00 
[INFO] Final Memory: 59M/457M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.15.1:validate (default) on project pApp-module-employment: 2 meta-model problems found. -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :pApp-module-employment 

내가 유사한 문제에 또 다른 질문을 수행하여 자신감에 치어에 !을 제거, 제발 도와주세요,하지만 작동하지 않습니다!

답변

2

simpleapp archetype은 도메인 논리에서 의미 론적 오류 (예 : 분리 된 지원 방법)를 검사하는 Apache Isis maven 플러그인의 "유효성 검사"목표를 실행하도록 사전 구성되어 있습니다. 스택에는 존재하지 않는 저장소를 참조하는 엔티티 중 하나 인 오류 중 하나가 표시됩니다.

maven 플러그인은 AppManifest에서 실행됩니다 (모듈 단순 모듈의 pom.xml에 있음).하지만 이것은 응용 프로그램을 부트 스트랩하는 데 사용되는 것과 동일한 AppManifest가 아닙니다. 이는 단일 모듈 용입니다.

Employee 엔티티가 ApplicationUser를 참조하므로 ApplicationUser가 메타 모델의 일부가되어 유효성이 검사됩니다. 내 생각 엔 Maven 플러그인에서 사용하는 AppManifest가 보안 모듈 (필수 리포지토리가 있음)을 참조하지 않고 오류를 트리거하고있는 것 같습니다.

해결 방안은이 AppManifest에 보안 모듈에 대한 선언을 추가하는 것입니다. 아마도 앱을 부트 스트랩하기 위해 사용하는 AppManifest에서 관련 라인을 복사 할 수 있습니다.

HTH

+0

나는'추가 SecurityModule.class'와'.withConfigurationProperty ( "isis.persistor.datanucleus.impl.javax.jdo.PersistenceManagerFactoryClass"후, "org.datanucleus.api.jdo.JDOPersistenceManagerFactory") .withConfigurationProperty ( "isis.persistor.datanucleus.impl.datanucleus.schema.autoCreateAll", "true") '를 내 AppManifest에 연결합니다. –

+0

이제 또 다른 예외'[ERROR]는 목표 org.apache.isis.tool을 실행하지 못했습니다 : isis-maven-plugin : 1.15.1 : 프로젝트에서 유효성 검사 (기본값) pApp-module-employment : 목표 org.apache의 실행 기본값. 유효성 검사 실패 : 클래스 추가/유효성 검사 중에 예외가 발생했습니다 : 유효하지 않은 스키마 이름 : 문에서 HR [CREATE TABLE HR.EMPLOYEE ' –

+0

마지막으로, 나는 mixin'incode-mavenmixin-validate'를 삭제하고 모든 것이 작동합니다. 고맙습니다!!! –