+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: plugins made with eclipse

  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts

    plugins made with eclipse

    Hello, I did a search for this, but i still cant see the problem.

    I have 2 extensions installed from the Unity3d examples (avatar chat and rts game). After getting things to work, I watched this video:
    http://www.youtube.com/watch?v=2Elug...eature=related

    I tried to follow it as best I can using Eclipse instead of NetBeans. Here at work, everyone uses eclipse for java development, so this is why I went with eclipse. To create my jar, I right click on the project and click export. This allows me to create a jar file. Also, there doesn't seem to be an option to creat a java lib, like in net beans. Anyway, when i try to install the hello world plugin I created (and i remove the other plugins) my plugin does not show up. (yes i restart ES5)

    If i dont remove the 2 extensions, and try to add in the plugin i created, I get this error:

    faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032" errorID=2032]. URL: http://localhost:8080/jmx/read/com.e...09462912753224'

    Here is java my code
    Code:
    import com.electrotank.electroserver5.extensions.BasePlugin;
    import com.electrotank.electroserver5.extensions.api.value.EsObject;
    import com.electrotank.electroserver5.extensions.api.value.EsObjectRO;
    
    public class main extends BasePlugin {
    
    		@Override
    		public void request(String playerName, EsObjectRO requestOb)
    		{
    			getApi().getLogger().debug(playerName+" sent request");
    			
    			if(requestOb.getString("action").equals("requestHello"))
    			{
    				EsObject sendOb = new EsObject();
    				sendOb.setString("action","hello sent");
    				sendOb.setString("message", "hello buddy!");
    				getApi().sendPluginMessageToUser(playerName, sendOb);
    			}
    		}
    }
    here is my Extension.xml
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <Extension>
    	<Name>HelloWorldExtension</Name>
        <Plugins>
            <Plugin>
                <Handle>helloWorld</Handle>
                <Type>Java</Type>
                <Path>main</Path>
            </Plugin>
        </Plugins>
    </Extension>
    im not sure what I did wrong, but any help is appreciated.

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Are you using a package? Is the name of your Java class "main.java"? After compiling your HelloWorld into a jar, did you deploy with the jar in a lib folder, and your Extension.xml in the same directory as the lib folder, with this directory being inside your server/extension folder?

    edit: try using a package in your project, and editing Extension.xml to match the new package name. Your code above isn't using any package at all.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    D'oh. Forgot the most common complaint! Try closing your ES Admin and opening it fresh. We have a known bug where new extensions don't show in the drop down list until ES Admin is restarted. That's supposed to be fixed for the next release.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  4. #4
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tcarr View Post
    Are you using a package? Is the name of your Java class "main.java"? After compiling your HelloWorld into a jar, did you deploy with the jar in a lib folder, and your Extension.xml in the same directory as the lib folder, with this directory being inside your server/extension folder?
    yes to all of the above. I made sure the structure matched the plugins examples that were working for me. However, I'm not sure what you mean by "using a package." I dont use java very often, so java terms are still foreign to me (I'm a C/C++ guy)
    Quote Originally Posted by tcarr View Post
    edit: try using a package in your project, and editing Extension.xml to match the new package name. Your code above isn't using any package at all.
    sorry to sound so n00bish, but how do i do this?

    Quote Originally Posted by tcarr View Post
    D'oh. Forgot the most common complaint! Try closing your ES Admin and opening it fresh. We have a known bug where new extensions don't show in the drop down list until ES Admin is restarted. That's supposed to be fixed for the next release.
    i restart both the admin program and electroserver.

    Thanks for your help so far.

  5. #5
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    If you restarted the ES Admin and the extension still isn't showing, then odds are that there's a problem with your deployed extension. At this point I think the fastest way for me to figure this out is if you zip up your extensions folder, upload it somewhere handy, and then send me a link to it. I can then eyeball it to see if the extension is using the correct structure, etc.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  6. #6
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts
    here is a zipped version of my extension

    http://kablammyman.webs.com/helloWorld.zip

  7. #7
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    What version of the ElectroServer5.jar was that compiled with? The error message I'm seeing when I try to deploy complains about it being version 51, and there isn't any version 51. ES5.1 doesn't like it either.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  8. #8
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts
    the path to that jar is C:\Program Files\ElectroServer_5_2_3\server\lib\ElectroServer 5.jar

    This is where the video told me to get it from.

  9. #9
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    I get the same problem with ES5.2.3. Hmmm.... what version of Java is your Eclipse using to compile? I haven't tested ES5 running on Java 1.7 yet, just with Java 1.6.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  10. #10
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts
    sorry about the delay, I was in a meeting. anyway, here is the eclipse info

    Eclipse IDE for Java Developers

    Version: Indigo Service Release 1
    Build id: 20110916-0149
    (c) Copyright Eclipse contributors and others 2000, 2011. All rights reserved.
    Visit http://eclipse.org/

    This product includes software developed by the
    Apache Software Foundation http://apache.org/
    I am using java 1.7. I have the option to use java 1.6 i believe.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts