Page 1 of 1

Compilation works, execution doesn't

PostPosted: 10 Aug 2014, 17:10
by Ratosai
Hi, I recently found Xmage and want to contribute, but I'm having trouble getting the compiled code to run correctly on Windows 8. I cloned the repository for Xmage, updated java, installed Maven, and compiled Xmage through the command line (using "mvn clean install -DskipTests", as some tests failed). I tried running the various startClientWin7.bat files in the "release" folders, but those gave "unable to access jar file", even though the path was correct. The "target" folders were also created and populated with the executable jars, but running them didn't work either. For example, running the jar in "Xmage.Client/target" makes the Xmage logo pop up briefly, then go away without actually launching the program. What am I doing wrong?

Re: Compilation works, execution doesn't

PostPosted: 10 Aug 2014, 18:32
by LevelX
I don't use it that way, so it's hard to assist you.

If you want to create a IDE independant compilation you can use the included perl script:
build-and-package.pl
That's the one I use to create a new version.

If you use Netbeans IDE I can be of more help I guess.
https://github.com/magefree/mage/wiki/Developer-Getting-Started

Re: Compilation works, execution doesn't

PostPosted: 10 Aug 2014, 21:11
by Ratosai
That worked beautifully, thank you! I completely overlooked the Utils folder.

Re: Compilation works, execution doesn't

PostPosted: 15 Aug 2014, 00:56
by rlinne
Sorry to revive a dead thread but I am having a similar issue in running the dev build.

I have tried the instructions provided at the Getting started section of GitHub and running the build-and-package.pl script in the Utils folder. I have also attempted a command line install with maven and received this error in both IDE (Netbeans) and command line.

"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mage-server: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]"

Any ideas on what I can do resolve this and start with development?

Thanks!

Re: Compilation works, execution doesn't

PostPosted: 15 Aug 2014, 07:36
by LevelX
rlinne wrote:Sorry to revive a dead thread but I am having a similar issue in running the dev build.

I have tried the instructions provided at the Getting started section of GitHub and running the build-and-package.pl script in the Utils folder. I have also attempted a command line install with maven and received this error in both IDE (Netbeans) and command line.

"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mage-server: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]"

Any ideas on what I can do resolve this and start with development?

Thanks!
Ok, You have compiled all projects with success?

Now you try to start the XMage server component from IDE and got that error?

Check that you have some things set to properties of Server project:
ServerRun.jpg

And than start the Server in debug mode by using the context menu:
ServerDebugStart.jpg


What OS System and Version of Netbeans and Java do you use?

Re: Compilation works, execution doesn't

PostPosted: 28 Aug 2014, 03:25
by JJ-Marcel
Figured maybe I could add to this thread with another build issue (not sure if you guys prefer new threads for new issues or not).

I checked out the code a number of days ago and finally had a chance to take a closer look. I've installed NetBeans since that seems to be the standard here but when trying to clean and build the project I'm failing a test, not the one mentioned above, but rather the test using Humility and Progenitus.


Code: Select all
testHumilityDeactivatesReplacementEffectAbilities(org.mage.test.cards.replacement.ZoneChangeReplacementTest)  Time elapsed: 0.279 sec  <<< FAILURE!
java.lang.AssertionError: (Graveyard) Card counts are not equal (Progenitus) expected:<1> but was:<0>
   at org.junit.Assert.fail(Assert.java:91)
   at org.junit.Assert.failNotEquals(Assert.java:645)
   at org.junit.Assert.assertEquals(Assert.java:126)
   at org.junit.Assert.assertEquals(Assert.java:470)
   at org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl.assertGraveyardCount(CardTestPlayerAPIImpl.java:640)
   at org.mage.test.cards.replacement.ZoneChangeReplacementTest.testHumilityDeactivatesReplacementEffectAbilities(ZoneChangeReplacementTest.java:156)
I figured maybe someone here might have a quick idea of why this specific issue is happening in my instance.

Windows 7. Java is up-to-date. Local repository is up-to-date.

Re: Compilation works, execution doesn't

PostPosted: 28 Aug 2014, 06:27
by LevelX
JJ-Marcel wrote:Figured maybe I could add to this thread with another build issue (not sure if you guys prefer new threads for new issues or not).

I checked out the code a number of days ago and finally had a chance to take a closer look. I've installed NetBeans since that seems to be the standard here but when trying to clean and build the project I'm failing a test, not the one mentioned above, but rather the test using Humility and Progenitus.
Hello JJ-Marcel,

that's perfectly fine because this bug is still not resolved in XMage.
https://github.com/magefree/mage/issues/533
So your envirement is ready to work and contribute. :D
If you have any more questions, this forum is the right place to ask.

Regards
LevelX2

Re: Compilation works, execution doesn't

PostPosted: 01 Sep 2014, 02:35
by JJ-Marcel
Great, unfortunately I'm now having an issue running Mage.Server. I can run Mage.Client, but I can't get the local server up as it's throwing some maven exceptions at me.

Code: Select all
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mage-server: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mage-server: Command execution failed.
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
   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.buildProject(LifecycleModuleBuilder.java:84)
One thing that might be worth mentioning is that when I build the root project I get the following warnings after "Scanning for projects..."

Code: Select all
Some problems were encountered while building the effective model for org.mage:mage-stats:war:1.3.0
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: net.minidev:json-smart:jar -> duplicate declaration of version 1.1.1 @ line 71, column 21
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.aspectj:aspectjrt:jar -> duplicate declaration of version 1.6.11 @ line 77, column 21
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 146, column 21

Re: Compilation works, execution doesn't

PostPosted: 01 Sep 2014, 05:40
by LevelX
JJ-Marcel wrote:Great, unfortunately I'm now having an issue running Mage.Server. I can run Mage.Client, but I can't get the local server up as it's throwing some maven exceptions at me.
I guess you set parameter like shown two post earlier and start it in debug mode?
Is the code you showed the full output if you try to start debug for the server project? If not can you please show the complete log.

Here is the start of the output if I start it on my system.

Code: Select all
NetBeans: JPDA Listening Start...
JPDA Address: Notebook:60180
Port:60180
cd C:\Users\Developer\Documents\NetBeansProjects\mageNew\Mage.Server; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_11" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=60180 -Xverify:none -client -Xss2m -Xms128m -Xmx512m -XX:PermSize=256m -classpath %classpath mage.server.Main -testMode=true -adminPassword=chef\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_11\\bin\\java.exe\" -Dexec.classpathScope=runtime -Djpda.listen=true -Djpda.address=60180 -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.2:exec\""
Scanning for projects...
                                                                       
------------------------------------------------------------------------
Building Mage Server 1.3.0
------------------------------------------------------------------------

--- maven-jaxb2-plugin:0.7.4:generate (default) @ mage-server ---
Cannot find CatalogManager.properties
Skipped XJC execution.  Generated sources were up-to-date.

--- maven-resources-plugin:2.5:resources (default-resources) @ mage-server ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources
Copying 0 resource
Copying 1 resource

--- maven-compiler-plugin:2.0.2:compile (default-compile) @ mage-server ---
Nothing to compile - all classes are up to date



JJ-Marcel wrote:Some problems were encountered while building the effective model for org.mage:mage-stats:war:1.3.0
You can ignore this, It comes from a new project not finished yet and has no influence on XMage server or client.

Re: Compilation works, execution doesn't

PostPosted: 01 Sep 2014, 05:45
by LevelX
JJ-Marcel wrote:Great, unfortunately I'm now having an issue running Mage.Server. I can run Mage.Client, but I can't get the local server up as it's throwing some maven exceptions at me.
Did you deactivate the "Compile on save" option in [Project]->Properties/Build/Compile/ tab? It brings up sometimes strange bugs. So best you deactivate it.

Re: Compilation works, execution doesn't

PostPosted: 02 Sep 2014, 01:29
by JJ-Marcel
Ah, you know what, I did not have my parameters set for the Mage Server project exactly like your posted image. Making that change fixed it, thanks! That would probably be helpful in the getting started guide. I presume this would also indeed be the solution for rlinne since his error seemed to be the same, although he has not responded.

Re: Compilation works, execution doesn't

PostPosted: 02 Sep 2014, 06:30
by LevelX
JJ-Marcel wrote:Ah, you know what, I did not have my parameters set for the Mage Server project exactly like your posted image. Making that change fixed it, thanks! That would probably be helpful in the getting started guide. I presume this would also indeed be the solution for rlinne since his error seemed to be the same, although he has not responded.
Great that you got it to work.

What was the causing parameter difference you did not set?