Preparing for Confluence 8.0 - EAP coming soon

Thanks @Kusal!

That note in the ticket explains why it is the way it is right now, but please also exempt /plugins/servlet from this filter. It doesn’t seem to make a lot of sense to run a struts preparation filter in front of something that isn’t struts :slight_smile:

In any case I wanted to thank you and the other Atlassian’s involved in this thread for the fast responses and action :+1:

Cheers,
Jens

1 Like

Hi, I found a funny one (still breaking stuff):

In a macro’s execute method, when calling

new StaticHttpContext().getRequest().getAttribute("whatever-1234")

it returns a double with value -1234, even though that attribute doesn’t exist (not included in the enumeration returned by getAttributeNames). Works with any number. :man_shrugging:
In my case this causes funny ClassCastExceptions because the code (rightfully) didn’t expect a number.

I could reproduce this on m76 and m82 (which is again not visible on the EAP page :wink:).

Forgot some debugging code?

Hi @jens

This seems to be standard Struts behaviour where if an attribute is not found, it will fallback to attempting to evaluate it as an OGNL expression. I’ve created a tracking issue for this here as this behaviour is understandably not always desirable.

But for now I would recommend avoiding the use of math operators in the attribute name, instead using something such as “whatever.1234” or “whatever_1234”.

1 Like

Thanks @Kusal,

in our case this was just <prefix>-<generated ID> where the ID happened to be a simple number. We can change the attribute name of course.

My two cents: It might make sense to disable the struts.disableRequestAttributeValueStackLookup for improved backwards compatibility, though. Unless it’s required by struts internally or the Confluence integration itself of course…

Hey @jponting,

Thanks for the info, I would like to follow up for more details about the replacement API here. As our app is defining lucene-query-mapper module in atlassian-plugin.xml. If I’m understanding it correctly, that says we need to replace it with a custom SearchQuery, TermQuery etc. I still bother with a few questions here:

  • Are there any documentation explaining how to implement it or how to replace it with lucene-query-mapper?

  • Are we need to define a module for a SearchQuery in the descriptor(as we are currently using lucene-query-mapper in the descriptor)?

Any advice would be appreciated!
Thanks.

1 Like

Hi,

I just realized that RC1 has been released :tada:

Yet the EAP page still shows In Progress for Removing deprecated code.

Can we assume that this is just an oversight and all deprecated APIs have been removed by now?

Thanks!

Can some Atlassian staff look at the topic Broken Java API in Confluence 8 EAP: ContentSearch, getById(), etc?

It seems impossible to build an app that works in Confluence 7.10-7.19 and 8 when using ContentSearch.

TL;DR
Check if you have an environment variable MAVEN_COLOR set and delete it.

I got the same error message as @scott.dudley in this Post when using JDK 11 or later. I dug a little deeper and found out that for me it is caused by the environment variable MAVEN_COLOR. It looks like the original Maven script has been modified to colorize the output (there is a file “mvn.orig” in the same directory, identical to my “standalone” Maven version). In the modified Maven executable there is an IF statement, which changes the Maven command depending on the environment variable and puts a library maven-trap-0.5.jar in the classpath and replaces the org.codehaus.plexus.classworlds.launcher.Launcher command with org.twdata.maven.trap.App. This library can also be seen in the stack trace of the NPE. I suspect that this lib does not work with JDK 11. Earlier I set this environment variable to have a colorful maven output. This is no longer necessary, at least for me, since it is the default.

This is the crucial place in the file .../atlassian-plugin-sdk-8.2.7/apache-maven-3.5.4/bin/mvn

if [ -z "$MAVEN_COLOR" ] ; then
  exec "$JAVACMD" \
    $MAVEN_OPTS \
    $MAVEN_DEBUG_OPTS \
    -classpath "${CLASSWORLDS_JAR}" \
    "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
    "-Dmaven.home=${MAVEN_HOME}"  \
    "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
    "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
    ${CLASSWORLDS_LAUNCHER} "$@"
else
  exec "$JAVACMD" \
    $MAVEN_OPTS \
    $MAVEN_DEBUG_OPTS \
    -cp "${CLASSWORLDS_JAR}":"${MAVEN_HOME}"/lib/maven-trap-0.5.jar \ # <---- !!!
    "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
    "-Dmaven.home=${MAVEN_HOME}"  \
    "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
    "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
    org.twdata.maven.trap.App "$@"
fi

Hi,

In Preparing for Confluence 8.0 | Confluence Data Center and Server 8.0 | Atlassian Documentation [Removal of Editor javascript global variables], Confluence.Editor global JS object should’ve been removed but it’s still available. Any plans to remove it or it will stay?

Hi @rr1 , did you get a solution for this problem? I am also having the same issue, but struggling to find the proper replacement, and the one suggested is not working either.

Please provide your feedback if you come across a solution.

Thanks
RK

Hi,

Has anyone having issue with AJS.MacroBrowser in Confluence 8.0? I have my JS web resource calling the AJS.MacroBrowser.open to open the macro browser in Confluence 8.0. But I got an undefined message on AJS.MacroBrowser, but it works on Confluence 7. Has it already been removed in 8.0? If yes, what will be the replacement?

image (1)

Any advice would be appreciated!

Best regards.

From where are you calling AJS.MacroBrowser? It depends on the context. We had a similar problem in one of our apps, but we noticed that the AJS.MacroBrowser resources are not available in every context anymore. For example, in one of our use cases we loaded editor resources #requireResourcesForContext("editor") to get all necessary editor objects.

Hi @MatthiasClasen

I’m calling AJS.MacroBrowser from one of our JS web resources and we include that resource from our velocity template with #requireResource("front-end-js").
<web-resource key="front-end-js" name="Front End Skin Resources">

We also have #requireResourcesForContext("macro-browser") in the velocity template, this is how we refer to the macro browser of AJS. If the AJS.MacroBrowser context is not available anymore, is there any replacement we can use?

Hm I just tried both resource-contexts on the dashboard and none of them has the AJS.MacroBrowser.

This is causing quite a frustration to our team as our macro depends on this AJS.MacroBrowser, without this, our macro will stop working on Confluence 8.0. This seems not available from Confluence 8.0 onwards, and there isn’t any notice(or they do have but missed it?)

Hi @ramakrishna,

I followed all the hints provided by NamHo (he answered multiple of my questions here!) on this page and finally got all my issues resolved. It was all about finding the correct module to reference …

Since you have referenced the editor … This is the dependency block for one of my web resources:

    <dependency>confluence.web.resources:ajs</dependency>
    <!-- Won't work here:
    <dependency>com.atlassian.confluence.plugins:confluence-editor-plugin</dependency>
     -->
    <dependency>confluence.web.resources:page-editor</dependency>
    <dependency>com.atlassian.confluence.editor:editor-resources</dependency>
    <dependency>confluence.editor.actions:editor-macro-browser</dependency>

And this is for another:

    <dependency>confluence.web.resources:ajs</dependency>
    <dependency>com.atlassian.confluence.plugins:confluence-editor-plugin</dependency>

Hope this helps!

Cheers,
Robert

1 Like

Thanks @rr1 ,

After replacing

<dependency>com.atlassian.confluence.tinymceplugin:editor-resources</dependency>

with
<dependency>com.atlassian.confluence.editor:editor-resources</dependency>

Our issues are resolved.

1 Like

Hello @rrobins .
I did not find the information about Bandana deprecation and the issue @scott.dudley mentioned in End of Support Announcements for Confluence | Confluence Data Center and Server 8.0 | Atlassian Documentation and the code being removed in 8.X :frowning:
Could you please tell were we can find this information and if using AO is a default approach now?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.