Active Objects and security errors

Hi,

I’m trying to use Active Objects inside a servlet, bundled in a custom plugin. But I have a very strange problem when adding this to the POM:

<pluginArtifacts>
   <pluginArtifact>
    <groupId>com.atlassian.activeobjects</groupId>
    <artifactId>activeobjects-plugin</artifactId>
    <version>${ao.version}</version>
  </pluginArtifact>
  <pluginArtifact>
    <groupId>com.atlassian.activeobjects</groupId>
    <artifactId>activeobjects-jira-spi</artifactId>
    <version>${ao.version}</version>
  </pluginArtifact>
</pluginArtifacts>

Jira starts, but when I try to go to any URL, I get:

Rejecting security-sensitive request that bypassed Johnson filter: /jira/secure/errors.jsp

Removing the two entries from the POM fix this issue… but the servlet module is not loaded.

What is the correct way to inject AO into a plugin? Latest SDK, running Jira 7.13.0 from the SDK.

Thanks.

On the surface, looks good to me. Can you actually look more closely at the log to see if there’s any other error showing up?

Wondering if it’s a caching issue. Have you seen this post on the User Community forums yet? https://community.atlassian.com/t5/Jira-questions/Connecting-to-Jira-gives-blank-webpage-with-address-errors-jsp/qaq-p/59827

In particular, going down to the accepted answer, and how to remove the plugin cache.

What is your ao.version declared as? Can your review your logs? More than likely there is an error towards the beginning of the startup of Jira.

I have always used AO as a dependency, not via pluginArtifact

<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>${ao.version}</version>
<scope>provided</scope>
</dependency>

Don’t know if that makes any difference

I then inject it via ComponentImport into the constructor

private ActiveObjects ao;

public MyClass(@ComponentImport ActiveObjects ao) {
    this.ao = ao;
}
2 Likes

I tried with 3.0.1 and 3.0.3.

I ran atlas-clean, so Jira is actually destroyed :slight_smile: I don’t see any errors.

Tried that too, but for this case, the module for AO is not loading. The definition is:

    <ao key="casewise" namespace="casewise">
        <description>The module configuring the Active Objects service used by this plugin</description>
        <entity>com.xxxx.collaboratif.jira.casewise.servlet.pojo.xxxx.x</entity>
        <entity>com.xxxx.collaboratif.jira.casewise.servlet.pojo.xxxx.xx</entity>
        <entity>com.xxxx.collaboratif.jira.casewise.servlet.pojo.xxxx.xxx</entity>
        <entity>com.xxxx.collaboratif.jira.casewise.servlet.pojo.xxxx.xxxx</entity>
    </ao>

But this module is unloaded in UPM.

Have you tried initialising the beans in an active objects test case?

https://developer.atlassian.com/server/framework/atlassian-sdk/testing/

entityManager.migrate will throw an error if there is a problem initialising them

Finally got an error:

net.java.ao.ActiveObjectsException: Invalid entity, generated table name (AO_9733B3_COMPOSANTE_APPLICATIVE) for 'com.desjardins.collaboratif.jira.casewise.servlet.pojo.casewise.ComposanteApplicative' is too long! It should be no longer than 30 chars.
1 Like

I’m now using the @Table annotation to shorten the table name while not reducing the class name.

1 Like

FYI, I am now using AO 2.0.0, same version as shipped with Jira 7.13.1.