我一直无法让我的maven项目工作。我将在我的pom文件和我的错误日志下面显示。我试图在部署后在glassfish上运行我的代码集成测试。任何帮助都感激不尽。如果有更好的解决方案,那也值得赞赏。
pom.xml货物部分:
<!-- cargo plugin -->
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-uberjar</artifactId>
<version>1.4.3</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- cargo plugin -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.3</version>
<configuration>
<container>
<containerId>glassfish4x</containerId>
<type>installed</type>
</container>
<configuration>
<type>existing</type>
<home>C:\glassFishV4\glassfish4\glassfish\domains</home>
<properties>
<cargo.hostname>localhost</cargo.hostname>
<cargo.servlet.port>4848</cargo.servlet.port>
<!-- if no username/password don't use these, it will fail -->
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.passwordFile>C:\glassfish\glassfish4\glassfish\domains\domain1\config\admin-keyfile</cargo.remote.passwordFile>
<cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.project</groupId>
<artifactId>projectID</artifactId>
<location>${project.build.directory}/${project.build.finalName}.war</location>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
错误日志:
C:\Users\kev\projectID\com.project.projectID-1.0>mvn -e cargo:start
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building projectID 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.3:start (default-cli) @ projectID ---
[INFO] [2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:car
go-core-container-glassfish:jar:1.4.3 for container glassfish4x
[INFO] [talledLocalContainer] GlassFish 4.x starting...
[INFO] [talledLocalContainer] Attempting to start domain1.... Please look at the
server log for more details.....
[INFO] [talledLocalContainer] Authentication failed for user: admin
[INFO] [talledLocalContainer] with password from password file: C:/glassFishV4/g
lassfish4/glassfish/domains/password.properties
[INFO] [talledLocalContainer] (Usually, this means invalid user name and/or pass
word)
[INFO] [talledLocalContainer] Command deploy failed.
[INFO] [talledLocalContainer] GlassFish 4.x is stopping...
[INFO] [talledLocalContainer] Waiting for the domain to stop .
[INFO] [talledLocalContainer] Command stop-domain executed successfully.
[INFO] [talledLocalContainer] GlassFish 4.x is stopped
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.139s
[INFO] Finished at: Fri Aug 16 16:19:33 EDT 2013
[INFO] Final Memory: 12M/304M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:star
t (default-cli) on project projectID: Execution default-cli of goal org.codehaus.c
argo:cargo-maven2-plugin:1.4.3:start failed: Failed to start the GlassFish 4.x c
ontainer. At least one GlassFish deployment has failed: org.codehaus.cargo.util.
CargoException: GlassFish admin command failed: asadmin exited 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.cargo:cargo-maven2-plugin:1.4.3:start (default-cli) on project projectID
: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:s
tart failed: Failed to start the GlassFish 4.x container.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
357)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
li of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:start failed: Failed to
start the GlassFish 4.x container.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
... 19 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to start the
GlassFish 4.x container.
at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(Abstrac
tLocalContainer.java:230)
at org.codehaus.cargo.maven2.ContainerStartMojo.executeLocalContainerAct
ion(ContainerStartMojo.java:96)
at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStart
Mojo.java:63)
at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:432)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:106)
... 20 more
Caused by: org.codehaus.cargo.util.CargoException: At least one GlassFish deploy
ment has failed: org.codehaus.cargo.util.CargoException: GlassFish admin command
failed: asadmin exited 1
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.doStart(AbstractGlassFishInstalledLocalContainer.java:193)
at org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer.star
tInternal(AbstractInstalledLocalContainer.java:313)
at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(Abstrac
tLocalContainer.java:211)
... 24 more
Caused by: org.codehaus.cargo.util.CargoException: GlassFish admin command faile
d: asadmin exited 1
at org.codehaus.cargo.container.glassfish.internal.GlassFish3xAsAdmin.in
vokeAsAdmin(GlassFish3xAsAdmin.java:88)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.invokeAsAdmin(AbstractGlassFishInstalledLocalContainer.java:
96)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.invokeAsAdmin(AbstractGlassFishInstalledLocalContainer.java:
69)
at org.codehaus.cargo.container.glassfish.GlassFish3xInstalledLocalDeplo
yer.doDeploy(GlassFish3xInstalledLocalDeployer.java:89)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalDeployer.redeploy(AbstractGlassFishInstalledLocalDeployer.java:97)
at org.codehaus.cargo.container.glassfish.internal.AbstractGlassFishInst
alledLocalContainer.doStart(AbstractGlassFishInstalledLocalContainer.java:174)
... 26 more
[ERROR]
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
奇怪的是,我可以看到它通过eclipse启动glassfish服务器然后停止它。我也试过默认没有密码和用户名,因为它们就是这样,正如你在这个配置中看到的那样,我使用了货物网站上描述的用户名和密码文件。我两次都收到同样的错误。
答案 0 :(得分:0)
只需抓住您的编辑器,打开airport_list = []
fees_list = []
airports = ["https://www.aopa.org/destinations/business/13035#fees"]
for a in airports:
driver.get(a)
time.sleep(3)
# Click dropdown
driver.find_element_by_xpath('//div[@class = "mat-select-arrow"]').click()
time.sleep(1)
# Select "All aircraft"
driver.find_elements_by_xpath('//span[@class = "mat-option-text"]')[8].click()
time.sleep(2)
try:
# Check if fees are available
driver.find_element_by_xpath('//mat-row[@class = "mat-row ng-star-inserted"]')
# Get number of items
number_of_items = driver.find_element_by_xpath('//div[@class = "mat-paginator-range-label"]').text.split()[-1]
#print(number_of_items)
if float(number_of_items) >= 11:
number_of_button_clicks = math.ceil(float(number_of_items)/10)
else:
number_of_button_clicks = 0
#print(number_of_button_clicks)
for click in range(0, number_of_button_clicks):
#Scrape each row
fees_table = driver.find_elements_by_xpath('//mat-row[@class = "mat-row ng-star-inserted"]')
for fee in fees_table:
fees_list.append(fee.text)
airport_list.append(a)
#Click on "Next" button
driver.find_elements_by_xpath('//span[@class = "mat-button-wrapper"]')[4].click()
time.sleep(2)
except:
fees_list.append("This location has not disclosed fees or does not charge fees.")
airport_list.append(a)
#print(fee_list)
#print(airport_list)
driver.close()
更改:
C:/glassFishV4/g
lassfish4/glassfish/domains/password.properties
收件人:
AS_ADMIN_PASSWORD=adminadmin