Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Java
You last visited: Today at 18:15

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Service Manager Registrieren

Discussion on Service Manager Registrieren within the Java forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2014
Posts: 22
Received Thanks: 0
Question Service Manager Registrieren

Deleted
DieSamu is offline  
Old 09/11/2015, 19:42   #2
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Ich nehme mal an es geht hier um Minecraft oder um genau zu sein um Bukkit, oder?

Dann wirst du vermutlich das suchen:

Edit:
Das könnte dann ungefähr so aussehen:
Code:
Bukkit.getServicesManager().register(GameAPI.class, myGameApi, myPlugin, ServicePriority.Normal);
Ich habe das hier im Textfeld gebastelt und auch noch nie selbst benutzt.
ComputerBaer is offline  
Old 09/11/2015, 20:20   #3
 
elite*gold: 0
Join Date: Apr 2014
Posts: 22
Received Thanks: 0
Deleted
DieSamu is offline  
Old 09/11/2015, 20:29   #4
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Ich würde jetzt mal vermuten, dass dein "myGameApi" beim Registrieren null ist. Du solltest vor dem Registrieren natürlich etwas wie myGameApi = new GameAPI(); machen.
ComputerBaer is offline  
Old 09/11/2015, 20:46   #5
 
elite*gold: 0
Join Date: Apr 2014
Posts: 22
Received Thanks: 0
Deleted
DieSamu is offline  
Old 09/11/2015, 21:06   #6
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Du redest jetzt davon:
Code:
RegisteredServiceProvider<GameAPI> GameAPIProvider = getServer().getServicesManager().getRegistration(GameAPI.class);
gameapi = GameAPIProvider.getProvider();

gameapi.meineFunktion(); // NullPointer
Schwer zu sagen ... fehlerhafte Reihenfolge? Erste meineFunktion und danach setupGameAPI.
Fehler in der GameAPI, der garnichts mit dem Service zu tun hat? meineFunktion() { "null".funktionx(); }

Es kann helfen, wenn du uns den Stacktrace geben würdest, dann lässt sich der Fehler deutlich einfacher lokalisieren. Mit dem Code wird es natürlich noch leichter.
ComputerBaer is offline  
Old 09/11/2015, 21:11   #7
 
elite*gold: 0
Join Date: Apr 2014
Posts: 22
Received Thanks: 0
Deleted
DieSamu is offline  
Old 09/11/2015, 23:36   #8
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Anhand des Fehlers würde ich vermuten, dass "utilities" in "GameAPI" dein NullPointer ist.
ComputerBaer is offline  
Old 09/12/2015, 13:53   #9


 
Menan's Avatar
 
elite*gold: 0
The Black Market: 169/0/0
Join Date: Sep 2008
Posts: 9,484
Received Thanks: 3,109
Du erstellt ja garkein wirkliches GameAPI Objekt, mit einer Referenz auf ein Utilities Object, da der Konstruktor deiner GameAPI Klasse nie aufgerufen wird...
Menan is offline  
Old 09/12/2015, 14:41   #10
Moderator


 
elite*gold: 558
Join Date: Feb 2010
Posts: 6,546
Received Thanks: 1,418
Quote:
Originally Posted by Menan View Post
Du erstellt ja garkein wirkliches GameAPI Objekt, mit einer Referenz auf ein Utilities Object, da der Konstruktor deiner GameAPI Klasse nie aufgerufen wird...
Ich glaube der Aufruf des Konstruktors passiert in der Plugin-Klasse des GameAPI-Plugins, welche wir hier jetzt nicht haben.

Die GameAPI-Klasse kommt aus dem Plugin "GameAPI" und die Game-Klasse aus dem Plugin "Spleef", es sind also zwei unterschiedliche Projekte. Da das GameAPI-Objekt im GameAPI-Plugin erstellt wird, sehen wir davon natürlich nichts im Spleef-Plugin.
ComputerBaer is offline  
Old 09/12/2015, 15:21   #11


 
Menan's Avatar
 
elite*gold: 0
The Black Market: 169/0/0
Join Date: Sep 2008
Posts: 9,484
Received Thanks: 3,109
Um das beurteilen zu können, bäuchte ich alle damit verbundenen Klassen...

Hab mich jetzt noch nie mit der Minecraft entwicklung ausseinandergesetzt..
Menan is offline  
Old 09/12/2015, 20:00   #12
 
elite*gold: 0
Join Date: Apr 2014
Posts: 22
Received Thanks: 0
Deleted
DieSamu is offline  
Reply

Tags
api, java, minecraft


Similar Threads Similar Threads
[WIP] Smurfs Manager & Referrals Service Order Manager
08/11/2014 - League of Legends Hacks, Bots, Cheats & Exploits - 11 Replies
As the title says, this is a WIP (Work In Progress) Thread, and obviously, these are 2 different applications, check spoilers below for screenshots and explanation of what these apps do, also, for moderators reading this, there's another thread by me in the discussions forum, just delete/close it, I didn't know you can post WIPs here. This application is probably made for people in high elo, or eloboosters, people with smurfs or people with eloboosting services, I don't think this...
[WIP] Smurfs Manager & Referrals Service Order Manager
08/11/2014 - League of Legends - 3 Replies
As the title says, this is a WIP (Work In Progress) Thread, and obviously, these are 2 different applications, check spoilers below for screenshots and explanation of what these apps do. This application is probably made for people in high elo, or eloboosters, people with smurfs or people with eloboosting services, I don't think this application needs a lot of explanation, neither the other one.. meh. You add an account, you submit the not-optional info that it needs, you press de button,...
Sql Server Service Manager
11/24/2012 - Dekaron Private Server - 2 Replies
Hey guys, my sql server service manager does not wanan start. :S it shows up at taskbar etc. and i can open it but if i presss start nothing happends it just stays off no matter how many times i press start.. :S but before it worked fine any 1 had this problem and knows how to fix this shit ? thanks :D
[B]Registrieren-Service[S]e*gold
04/11/2012 - elite*gold Trading - 23 Replies
Hallo, Ich biete hier meine Dienste an, ich registriere mich in foren o.ä. einfach per pn oder hier melden und will dafür e*gold wie viel ihr mir für was gebt können wir per pn besprechen einfach mal anschreiben. Wenn es sich um Refs handelt kann ich wenn der Preis passt auch aktiv die links o.ä. klicken Meine Einzige Voraussetzung : - Die Seite muss sicher sein und die Anmeldung kostenlos !
[SQL Server Service Manager Help]
05/22/2010 - Dekaron Private Server - 14 Replies
Okay so here's my problem. I went to bed and then woke up to find that my SQL Server Service Manager wont start. It sits there saying "Starting" and I haven't changed anything. The server is the same and the service too. Here's a pic. http://img263.imageshack.us/img263/1310/capturegv z.png Okay so I need to know why It would start before and now it's not. :( If you know something I don't, Please leave the solution here.



All times are GMT +1. The time now is 18:16.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.