Netbeans系统构建失败

时间:2017-10-25 11:23:55

标签: java netbeans jar

我有一个关于netbeans构建失败的问题 在部署netbeans期间,发生了这种情况。

Updating property file: 

    C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystemLibrary\build\built-clean.properties

Deleting directory C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystemLibrary\build
    C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystem\nbproject\build-impl.xml:212: The following error occurred while executing this line:
    C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystem-ejb\nbproject\build-impl.xml:789: The following error occurred while executing this line:
    C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystemLibrary\nbproject\build-impl.xml:912: The following error occurred while executing this line:
    C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystemLibrary\nbproject\build-impl.xml:1394: Unable to delete file C:\Users\Documents\NetBeansProjects\OnlineAuctionSystem\OnlineAuctionSystem\OnlineAuctionSystemLibrary\dist\OnlineAuctionSystemLibrary.jar

在部署系统期间从glassfish发送服务器日志。

Severe:   Exception while deploying the app [OnlineAuctionSystem]
Severe:   Exception during lifecycle processing
java.lang.IllegalArgumentException: Cannot resolve reference [Remote ejb-ref name=ejb.session.singleton.DataInitializationSessionBean/employeeControllerLocal,Remote 3.x interface =ejb.session.stateless.EmployeeControllerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session] because there are [2] ejbs in the application with interface ejb.session.stateless.EmployeeControllerLocal. 
Some of the possible causes: 
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. 
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
    at com.sun.enterprise.deployment.util.ComponentValidator.accept(ComponentValidator.java:356)
    at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:409)
    at org.glassfish.ejb.deployment.descriptor.EjbDescriptor.visit(EjbDescriptor.java:2855)
    at org.glassfish.ejb.deployment.descriptor.EjbDescriptor.visit(EjbDescriptor.java:2843)
    at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:115)
    at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:625)
    at org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl.visit(EjbBundleDescriptorImpl.java:757)
    at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:121)
    at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:625)
    at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:703)
    at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:248)
    at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:232)
    at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:193)
    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:227)
    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:881)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:821)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:748)

Severe:   Exception while deploying the app [OnlineAuctionSystem] : Cannot resolve reference [Remote ejb-ref name=ejb.session.singleton.DataInitializationSessionBean/employeeControllerLocal,Remote 3.x interface =ejb.session.stateless.EmployeeControllerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session] because there are [2] ejbs in the application with interface ejb.session.stateless.EmployeeControllerLocal. 
Some of the possible causes: 
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. 
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.

我继续遇到这个错误。我以前解决它的问题是转到文件夹并自己删除jar文件。我也停止/终止玻璃鱼服务器并取消部署客户端&系统。 我可以知道如何解决它?那可以做些什么呢?

感谢您的帮助! :)

2 个答案:

答案 0 :(得分:0)

我不知道问题是什么,如果可能的话,共享日志。 您可以尝试:转到项目的属性 - >如果您不使用它,则库并删除此jar文件。 我猜它。分享更多细节。

答案 1 :(得分:0)

我一直认为这是因为库jar文件被锁定了。但有人帮助我,并在我的错误代码中告诉我这一行

java.lang.IllegalArgumentException: Cannot resolve reference [Remote ejb-ref name=ejb.session.singleton.DataInitializationSessionBean/employeeControllerLocal,Remote 3.x interface =ejb.session.stateless.EmployeeControllerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session] because there are [2] ejbs in the application with interface ejb.session.stateless.EmployeeControllerLocal. 

发生的事情是我有另一个控制器,CustomerControllerLocal使用相同的本地和远程会话。

例如:这是员工控制器类。

@Stateless
@Local(CustomerControllerLocal.class)  //I should put EmployeeControllerLocal
@Remote(Customer ControllerRemote.class) //Same goes for here, remote.

public class EmployeeController implements EmployeeControllerRemote, EmployeeControllerLocal {
 //ommited the rest
}

小而粗心的错误!感谢大家观看此内容。