entity-----------------------------------------------
@Entity(name = "ACC_ACCNTREQ_LST")
@Builder
@Getter @Setter
@NoArgsConstructor @AllArgsConstructor
public class AccAccntReqLst implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GenericGenerator(name="seq_sno", strategy="com.pams.core.data.generator.IdGenerator")
@GeneratedValue(generator="seq_sno")
@Column(name = "accnt_req_no")
private String accntReqNo;
@Column(name = "req_dy" ,nullable=false)
private String reqDy;
@Column(name = "emp_id" ,nullable=false)
private String empId;
@Column(name = "emp_fg" ,nullable=false)
private String empFg;
@Column(name = "systm_id" ,nullable=false)
private String systmId;
@Column(name = "accnt_req_fg" ,nullable=false)
private String accntReqFg;
@Column(name = "systm_login_id" ,nullable=false)
private String systmLoginId;
@Column(name = "req_rsn" , length = 500)
private String reqRsn;
@Column(name = "aprv_sts" ,nullable=false)
private String aprvSts;
@Column(name = "cnswork_cd")
private String cnsworkCd;
@Column(name = "draftr_id")
private String draftrId;
@Column(name = "req_id")
private String reqId;
@Column(name = "ch_fg_cd" ,nullable=false)
private String chFgCd;
@Column(name = "del_yn" ,nullable=false)
private String delYn;
//권한생성여부
@Column(name = "auth_cre_yn" ,nullable=false)
private String authCreYn;
@Column(name = "rp_draftr_id")
private String rpDraftrId;
@Column(name = "re_draft_yn")
private String reDraftYn;
@Column(name = "re_req_yn")
private String reReqYn;
@Column(name = "reg_dt", nullable=false)
private LocalDateTime regDt;
@Column(name = "reg_id")
private String regId;
@Column(name = "upd_dt")
private LocalDateTime updDt;
@Column(name = "upd_id")
private String updId;
}
service impl-----------------------------------------------
package com.pams.core.service.impl;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.pams.core.data.request.AuthSearchForm;
import com.pams.core.entity.AccAccntReqLst;
import com.pams.core.repository.AccAccntReqLstRepository;
import com.pams.core.service.AuthorityService;
@Service
public class AuthorityServiceImpl implements AuthorityService{
private AccAccntReqLstRepository repository;
public AuthorityServiceImpl() {
}
@Autowired
public AuthorityServiceImpl(AccAccntReqLstRepository repository) {
super();
thiss.repository = repository;
}
@Override
public Page<AccAccntReqLst> getAccAccntReqLst(AuthSearchForm authSearchForm, Pageable pageable) {
Page<AccAccntReqLst> accAccntReqLst = repository.search(authSearchForm,pageable);
return accAccntReqLst;
}
}
service-----------------------------------------------
package com.pams.core.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.pams.core.data.request.AuthSearchForm;
import com.pams.core.entity.AccAccntReqLst;
public interface AuthorityService {
public Page<AccAccntReqLst> getAccAccntReqLst(AuthSearchForm authSearchForm, Pageable pageable);
}
controller -----------------------------------------------
@RequestMapping(value="/auth/conditionList", method=RequestMethod.POST)
public ResponseEntity<Page<AccAccntReqLst>> authConditionList2(AuthSearchForm authSearchForm, int pageNo) {
Pageable pageable = PageRequest.of(pageNo <= 0 ? 0 : pageNo - 1, 3);
Page<AccAccntReqLst> accAccntReqLst = authorityService.getAccAccntReqLst(authSearchForm,pageable);
return new ResponseEntity<Page<AccAccntReqLst>>(accAccntReqLst, HttpStatus.OK);
}
repository-----------------------------------------------
package com.pams.core.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.pams.core.entity.AccAccntReqLst;
import com.pams.core.repository.querydsl.AccAccntReqLstRepositoryQuerydsl;
@Repository
public interface AccAccntReqLstRepository extends JpaRepository<AccAccntReqLst, String>,AccAccntReqLstRepositoryQuerydsl{
}
custom repository-----------------------------------------------
package com.pams.core.repository.querydsl;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.pams.core.data.request.AuthSearchForm;
import com.pams.core.entity.AccAccntReqLst;
public interface AccAccntReqLstRepositoryCustom {
Page<AccAccntReqLst> search(AuthSearchForm authSearchForm, Pageable pageable);
}
QuerydslRepositorySupport-----------------------------------------------
package com.pams.core.repository.querydsl;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
import org.springframework.stereotype.Repository;
import com.pams.core.data.request.AuthSearchForm;
import com.pams.core.entity.AccAccntReqLst;
import com.pams.core.entity.QAccAccntReqLst;
import com.querydsl.core.QueryResults;
@Repository
public class AccAccntReqLstImpl extends QuerydslRepositorySupport implements AccAccntReqLstRepositoryCustom {
public AccAccntReqLstImpl() {
super(AccAccntReqLst.class);
}
@Override
public Page<AccAccntReqLst> search(AuthSearchForm authSearchForm, Pageable pageable) {
QAccAccntReqLst aarl = QAccAccntReqLst.accAccntReqLst;
QueryResults<AccAccntReqLst> query = from(aarl).fetchResults();
return new PageImpl<>(query.getResults(), pageable, query.getTotal());
}
}
ошибка консоли
...
... создание сущности
...
3월 08, 2019 7:38:55 오후 org.apache.catalina.core.StandardContext listenerStart
심각: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accAccntReqLstRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract org.springframework.data.domain.Page com.pams.core.repository.querydsl.AccAccntReqLstRepositoryQuerydsl.search(com.pams.core.data.request.AuthSearchForm,org.springframework.data.domain.Pageable)! No property search found for type AccAccntReqLst!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:827)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract org.springframework.data.domain.Page com.pams.core.repository.querydsl.AccAccntReqLstRepositoryQuerydsl.search(com.pams.core.data.request.AuthSearchForm,org.springframework.data.domain.Pageable)! No property search found for type AccAccntReqLst!
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:82)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:208)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:79)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lookupQuery(RepositoryFactorySupport.java:566)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(RepositoryFactorySupport.java:559)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1049)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.mapMethodsToQuery(RepositoryFactorySupport.java:561)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$new$0(RepositoryFactorySupport.java:551)
at java.util.Optional.map(Optional.java:215)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:551)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:324)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297)
at org.springframework.data.util.Lazy.getNullable(Lazy.java:211)
at org.springframework.data.util.Lazy.get(Lazy.java:94)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741)
... 21 more
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property search found for type AccAccntReqLst!
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94)
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:382)
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358)
at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:311)
at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324)
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:293)
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:276)
at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81)
at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251)
at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381)
at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93)
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:76)
... 47 more
3월 08, 2019 7:38:55 오후 org.apache.catalina.core.StandardContext startInternal
심각: One or more listeners failed to start. Full details will be found in the appropriate container log file
3월 08, 2019 7:38:55 오후 org.apache.catalina.core.StandardContext startInternal
심각: Context [] startup failed due to previous errors
3월 08, 2019 7:38:55 오후 org.apache.catalina.core.ApplicationContext log
정보: Closing Spring root WebApplicationContext
3월 08, 2019 7:38:55 오후 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
경고: The web application [ROOT] registered the JDBC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
3월 08, 2019 7:38:55 오후 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
심각: The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@30e0a059]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
3월 08, 2019 7:38:55 오후 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
심각: The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7b6dd732]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
3월 08, 2019 7:38:55 오후 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["http-nio-8080"]
3월 08, 2019 7:38:55 오후 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["ajp-nio-8009"]
3월 08, 2019 7:38:55 오후 org.apache.catalina.startup.Catalina start
정보: Server startup in 14433 ms
Извините, я пропустил свой английский.
Это не будет работать.
Пожалуйста, помогите мне
Он не будет работать при запуске Tomcat.
java-версия = 1.8 openJdk,
tomcat8.5
SpringMvc и Gradle
Когда выполняется Tomcat, сущности хорошо генерируются. Не найден поиск свойства для типа AccAccntReqLst.
Можете ли вы сказать мне, что мне не хватает?