Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在命令行中批量创建域,但不通过exec maven插件_Maven_Glassfish_Exec Maven Plugin_Asadmin - Fatal编程技术网

在命令行中批量创建域,但不通过exec maven插件

在命令行中批量创建域,但不通过exec maven插件,maven,glassfish,exec-maven-plugin,asadmin,Maven,Glassfish,Exec Maven Plugin,Asadmin,我编写了一个包含Glassfish域创建序列的小文件,如下所示: create-domain --adminPort 4848 --instancePort 8080 pouet start-domain pouet create-jdbc-connection-pool --datasourceclassname=org.apache.derby.jdbc.ClientDataSource --restype=javax.sql.ConnectionPoolDataSource --valid

我编写了一个包含Glassfish域创建序列的小文件,如下所示:

create-domain --adminPort 4848 --instancePort 8080 pouet
start-domain pouet
create-jdbc-connection-pool --datasourceclassname=org.apache.derby.jdbc.ClientDataSource --restype=javax.sql.ConnectionPoolDataSource --validationmethod=meta-data --description="Client datasource using an external Derby instance" --property port=1527:password=pouet:user=pouet:serverName=localhost:databaseName=pouet:connectionAttributes=create\\=true jdbc/datasource/pouet
create-jms-resource --restype javax.jms.ConnectionFactory --description "Standard pouet connection factory" jms/pouet/ConnectionFactory
create-jms-resource --restype javax.jms.Topic --property Name=jms_CrudServiceNotifier jms/CrudServiceNotifier
create-jms-resource --restype javax.jms.Topic jms/TaskExecution
create-jms-resource --restype javax.jms.Topic jms/TaskExecution/InDesign
deploy --force "C:\\Documents and Settings\\ndx\\.m2\\repository\\com\\netoprise\\neo4j-connector\\0.1-SNAPSHOT\\neo4j-connector-0.1-SNAPSHOT.rar"
create-connector-connection-pool --raname=neo4j-connector-0.1-SNAPSHOT --connectiondefinition=com.netoprise.neo4j.connection.Neo4JConnectionFactory  --property=xa=true:dir=\$\{com.sun.aas.instanceRoot\}/lib/databases/neo4j Neo4jPool
create-connector-resource --poolname=Neo4jPool neo4j/pool
我通常在玻璃鱼身上跑这些步

当使用以下说明手动运行所有这些时

E:\java-ext\glassfish3\bin\asadmin.bat --user "pouet" --passwordfile src\main\config\glassfish.password multimode --file target\config\current\create-domain.txt
执行不到两分钟

但是当使用以下pom配置通过maven运行它时

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2</version>
                    <executions>
                        <execution>
                            <id>create start and configure domain</id>
                            <phase>package</phase>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <executable>${glassfish.asadmin}</executable>
                        <arguments>
                            <argument>--user</argument>
                            <argument>"${glassfish.user}"</argument>
                            <argument>--passwordfile</argument>
                            <argument>"${glassfish.passwordFile}"</argument>
                            <argument>multimode</argument>
                            <!-- - - file is a multimode subcommand parameter, and not an asadmin parameter -->
                            <argument>--file</argument>
                            <argument>"${user.glassfish.config.path}/create-domain.txt"</argument>
                        </arguments>
                    </configuration>
                </plugin>
表明,对于exec maven插件生成的所有进程,绝对没有CPU消耗

此外,execmaven插件创建的命令行是

[DEBUG] Executing command line: cmd /c E:\java-ext\glassfish3\bin\asadmin.bat --user "pouet" --passwordfile "E:\JavaWorkspace\pouet\pouet-ear/src/main/config/glassfish.password" multimode --file "E:\JavaWorkspace\pouet\pouet-ear/target/config/current/create-domain.txt"
这和我手工输入的完全一样

所以。。。什么可能会让这个过程挂起?我能做些什么来解决这个问题

[编辑]添加--verbose标志以启动域指令显示为进程挂起以下指令前的最后一行:

4 août 2011 16:05:58 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 16 msec.
[#|2011-08-04T16:06:03.078+0200|INFO|glassfish3.1|null|_ThreadID=1;_ThreadName=Thread-1;|Running GlassFish Version: GlassFish Server Open Source Edition 3.1 (build 43)|#]

[#|2011-08-04T16:06:03.156+0200|INFO|glassfish3.1|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=10;_ThreadName=Thread-1;|Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]

[#|2011-08-04T16:06:03.843+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=27;_ThreadName=Thread-1;|Grizzly Framework 1.9.31 started in: 297ms - bound to [0.0.0.0:8181]|#]

[#|2011-08-04T16:06:03.859+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=28;_ThreadName=Thread-1;|Grizzly Framework 1.9.31 started in: 266ms - bound to [0.0.0.0:4848]|#]

[#|2011-08-04T16:06:03.859+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=32;_ThreadName=Thread-1;|Grizzly Framework 1.9.31 started in: 219ms - bound to [0.0.0.0:3700]|#]

[#|2011-08-04T16:06:03.859+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;|Grizzly Framework 1.9.31 started in: 391ms - bound to [0.0.0.0:8080]|#]

[#|2011-08-04T16:06:03.921+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=35;_ThreadName=Thread-1;|Grizzly Framework 1.9.31 started in: 15ms - bound to [0.0.0.0:7676]|#]

[#|2011-08-04T16:06:04.109+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=Thread-1;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (3 360ms), startup services(1 656ms), total(5 016ms)|#]

[#|2011-08-04T16:06:05.281+0200|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=46;_ThreadName=Thread-1;|JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://172.27.63.177:8686/jndi/rmi://172.27.63.177:8686/jmxrmi|#]

如果有人知道在JMX之后要启动什么,以及有什么可能阻止它启动,我想,这将帮助我修复这个奇怪的错误。

在完成了比我预期更多的maven katas之后,我现在找到了一个解决方案。这(显然)是正确的

使用so,我用以下maven antrun代码替换了maven exec配置

                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>create start and configure domain</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <failOnError>true</failOnError>
                                <target>
                                    <exec executable="${glassfish.asadmin}" dir="${glassfish.asadmin.path}"
                                        failonerror="true" vmlauncher="false">
                                        <arg value="--echo"/>
                                        <arg value="true"/>
                                        <arg value="--interactive"/>
                                        <arg value="false"/>
                                        <arg value="--user"/>
                                        <arg value="${glassfish.user}"/>
                                        <arg value="--passwordfile"/>
                                        <arg value="${glassfish.passwordFile}"/>

                                        <arg value="multimode"/>

                                        <arg value="--printprompt=false"/>
                                        <arg value="--file"/>
                                        <arg value="${user.glassfish.config.path}/create-domain.txt"/>
                                    </exec>
                                </target>
                            </configuration>
                        </execution>
                    </executions>
org.apache.maven.plugins
maven antrun插件
创建启动和配置域
过程资源
跑
真的
而且它非常有效

                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>create start and configure domain</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <failOnError>true</failOnError>
                                <target>
                                    <exec executable="${glassfish.asadmin}" dir="${glassfish.asadmin.path}"
                                        failonerror="true" vmlauncher="false">
                                        <arg value="--echo"/>
                                        <arg value="true"/>
                                        <arg value="--interactive"/>
                                        <arg value="false"/>
                                        <arg value="--user"/>
                                        <arg value="${glassfish.user}"/>
                                        <arg value="--passwordfile"/>
                                        <arg value="${glassfish.passwordFile}"/>

                                        <arg value="multimode"/>

                                        <arg value="--printprompt=false"/>
                                        <arg value="--file"/>
                                        <arg value="${user.glassfish.config.path}/create-domain.txt"/>
                                    </exec>
                                </target>
                            </configuration>
                        </execution>
                    </executions>