Hi, all
I've written a soap service plugin for jira, and it works in JIRA-4.4.3, however, after i upgrage jira to JIRA5.0.1 , the plugin can't be enable because some error like this:
There was an error loading the descriptor 'Extension SOAP Service' of plugin 'com.mycompany.jira.plugin.ChangeHistorySoap'. Disabling. com.atlassian.plugin.PluginParseException: Error retrieving dependency of class: com. mycompany.jira.plugin.rpc.soap.ExtensionSoapServiceImpl. Missing class: com/atlassian/jira/rpc/exception/RemoteException
actually, i do have import the class com/atlassian/jira/rpc/exception/RemoteException in the ExtensionSoapServiceImpl file. Does anybody know what happened?
PS:in jira-4.4.3, I add a dependency like below into pom.xml :
<dependency> <groupId>com.atlassian.jira.plugins</groupId> <artifactId>atlassian-jira-rpc-plugin</artifactId> <version>4.4.1</version> <scope>provided</scope> </dependency>
Should I change the dependency to
<dependency> <groupId>com.atlassian.jira.plugins</groupId> <artifactId>atlassian-jira-rpc-plugin</artifactId> <version>5.0.5</version> <scope>provided</scope> </dependency>
Did you read
at https://developer.atlassian.com/display/JIRADEV/Preparing+for+JIRA+5.0 ?
You need to import all the components that you inject in your constructor.
EDIT: Actually the found solution i found now is to "inline" the original rpc plugin jar into the the plugins META-INF/lib which avoids the class loading problems caused by trying to use the service interface TokenManger from the original rpc plugin in thevplugin. This solution also avoids problems with overwriting tokens when clients access both the original rpc service and the one provided the plugin. Hopefully this works in your environment as wellThanks for your resource. you mean i need to add a component-import xml node in atlassian-plugin.xml ?
<component-import key="helloWorldService"> <interface>com.myapp.HelloWorldService</interface> </component-import> <component> ... </component>
And what about the dependency about rpc plugin in pom.xml file ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use " com.atlassian.jira.rpc.auth.TokenManager" to manager the "login/logout" actions, It seems still not work .
my atlassian-plugin.xml is like below :
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}" /> </plugin-info> <component key="extension-soap-component" name="Extension SOAP Component" class="com.mycom.jira.plugin.rpc.soap.ExtensionSoapServiceImpl"> <interface>com.mycom.jira.plugin.rpc.soap.ExtensionSoapService</interface> </component> <rpc-soap key="extension-soap-service" name="Extension SOAP Service" class="com.mycom.jira.plugin.rpc.soap.ExtensionSoapServiceImpl"> <description>Extension SOAP Service.</description> <service-path>extensionsoapservice</service-path> <published-interface>com.mycom.jira.plugin.rpc.soap.ExtensionSoapService</published-interface> </rpc-soap> </atlassian-plugin>
In ExtensionSoapServiceImpl.java, I import some class like this:
import com.atlassian.jira.rpc.auth.TokenManager; import com.atlassian.jira.rpc.exception.RemoteAuthenticationException; import com.atlassian.jira.rpc.exception.RemotePermissionException; import com.atlassian.jira.rpc.exception.RemoteException;
After i enable the plugin, it always give the log "Missing class: com
/atlassian/jira/rpc/exception/RemoteException
"...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I change the component to component-import node as you said and modify the scope to compile, the plugin is enabled success, however, it can't generate the wsdl xml file in /extensionsoapservice?wsdl.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your remind . I've considered this risk before. Now i want to upgrate a SOAP plugin(to fetch the issue change history) which can work in JIRA4.4.3 to make sure i can work in JIRA 5/5.0.1. After that i'll try to fix this token risk . But it always give me error info shows like " Error retrieving dependency of class: com.intel.jira.plugin.rpc.soap.ExtensionSoapServiceImpl. Missing class: com/atlassian/jira/rpc/auth/TokenManager" . It seems there is something wrong about the original RPC Plugin in dependency (pom.xml).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To be more precisa about MyRpcImpl.java
package com.test.jira.rpc; import com.atlassian.jira.bc.security.login.LoginService; import com.atlassian.jira.rpc.auth.TokenManager; import com.atlassian.jira.rpc.auth.TokenManagerImpl; import com.atlassian.jira.rpc.exception.RemoteException; import com.atlassian.jira.security.JiraAuthenticationContext; import com.atlassian.jira.security.PermissionManager; import com.atlassian.jira.user.util.UserManager; import com.test.jira.rpc.MyRpc; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MyRpcImpl implements MyRpc{ private static final Logger log = LoggerFactory.getLogger(MyRpcImpl.class); TokenManager tokenManager; public MyRpcImpl(PermissionManager permissionManager, LoginService loginService, JiraAuthenticationContext authenticationContext, UserManager userManager) { tokenManager = new TokenManagerImpl(permissionManager, loginService, authenticationContext, userManager); } @Override public String echo(String s) { return s; } @Override public String login(String username, String password) throws RemoteException { return tokenManager.login(username, password); } @Override public boolean logout(String token) { return tokenManager.logout(token); } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just created a test project with this atlassian-plugin.xml which works
<?xml version="1.0" encoding="UTF-8"?> <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}"/> </plugin-info> <component name="My Rpc Component" i18n-name-key="my-rpc.name.component" key="my-rpc-component" class="com.test.jira.rpc.MyRpcImpl" public="false"> <description key="my-rpc.description.component">Component For My Rpc</description> <interface>com.test.jira.rpc.MyRpc</interface> </component> <resource type="i18n" name="i18n" location="atlassian-plugin"/> <rpc-soap name="My Rpc" i18n-name-key="my-rpc.name" key="my-rpc" class="com.test.jira.rpc.MyRpcImpl"> <description key="my-rpc.description">The My Rpc Plugin</description> <service-path>myrpc-v1</service-path> <published-interface>com.test.jira.rpc.MyRpc</published-interface> </rpc-soap> </atlassian-plugin>
The service interface MyRPC.java is
package com.test.jira.rpc;
...
public interface MyRpc {
String echo(String s);
String login(String user, String password) throws RemoteAuthenticationException, RemoteException;
boolean logout (String token);
...
The implementation class MyRpcImpl.java is
package com.test.jira.rpc; ... public String echo(String s) { return s; } public String login(String username, String password) throws RemoteException { return tokenManager.login(username, password); } public boolean logout(String token) { return tokenManager.logout(token); } ..
<?xml version="1.0" encoding="UTF-8"?> ...
<dependency> <groupId>com.atlassian.jira.plugins</groupId> <artifactId>atlassian-jira-rpc-plugin</artifactId> <version>5.0.5</version> <scope>compile</scope> </dependency> ... </project>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your examples very much. There is a similar solution with yours in https://answers.atlassian.com/questions/12512/how-to-authenticate-security-token-inside-custom-jira-plugin . Both two solutions work for me . Thank you again .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.