Hi @clouless,
Please use com.atlassian.confluence.api.service.backuprestore.BackupRestoreService for any xml backup/restore operations. It should be available for plugins.
For adding/removal of space permissions you could use com.atlassian.confluence.security.SpacePermissionManager. Even though methods removePermission and savePermission are deprecated, we don’t remove them yet. DefaultPermissionManager (which implements this interface) will call corresponding internal functions. The idea was that we will eventually introduce java api for space permission management, but unfortunately it wasn’t added yet.
Thanks for the clarification. I have already found another solution, but will keep it in mind.
The PermissionManager methods seem deprecated for over 10 years. Maybe you want to fix that with Confluence 9.0.0 because we are all very focused on removing deprecated API stuff because of the big Grey-API-Removal And all deprecated messages IntelliJ displays is now very frightening
We’re having the same problem since Confluence 8.9 .
It keeps asking for a dependency (com.opensymphony.module.propertyset) that we don’t use in our project. Even though we’ve made sure our MANIFEST.MF file doesn’t list this dependency, Confluence still acts like we need it.
As our MANIFEST.MF does not include the dependency on purpose so that’s why we did not see using debug on maven build the like you suggested @scott.dudley
Even a simple piece of code that uses com.atlassian.confluence.user.UserAccessor runs into this problem. Here’s an example:
import com.atlassian.confluence.user.UserAccessor;
public class TestErrorClass {
protected UserAccessor userAccessor;
public UserAccessor getUserAccessor() { return userAccessor; }
}
We’re stuck because it seems like Confluence forces this dependency no matter what, but we don’t know why. Has anyone else dealt with this? How did you fix it?
2024-03-26 12:19:36,225 WARN [UpmAsynchronousTaskManager:thread-2] [osgi.hook.dmz.DmzResolverHook] filterMatches Package org.apache.batik.anim.dom is deprecated and is not available for export to plugin com.valiantys.spreadsheets
I want to confirm that Spring Java Config is the way to go.
Now, we’re facing many warnings like:
[jersey.internal.Errors] logErrors The following warnings have been detected: WARNING: HK2 service reification failed for [one of our REST api classes] with an exception:\nMultiException stack 1 of 2\njava.lang.NoSuchMethodException: Could not find a suitable constructor in [one of our REST api classes] class.\n\tat org.glassfish.jersey.inject.hk2.JerseyClassAnalyzer.getConstructor...
although it works!
Also, the following internal packages warnings: com.atlassian.confluence.util.io but it is part of AttachmentTextExtractor as in @Override public Optional<InputStreamSource> extract(Attachment att)
org.apache.commons.io, org.apache.commons.io.output which we don’t user in our code
Hi,
EDIT: Figured out that I messed up my postgres db setup at some point. Working fine again now.
I checked out the last milestones. I can start m11 (and older milestones) just fine with my docker setup, but any milestone after that, the cachemanager crashes. Any pointers about something that changed which I have to change somewhere in my setup?
02-Apr-2024 10:07:58.817 SEVERE [https-jsse-nio-8015-exec-2] org.apache.catalina.core.StandardHostValve.custom Exception Processing [ErrorPage[errorCode=500, location=/500page.jsp]]
confluence-confluenceServer-p7 | java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
confluence-confluenceServer-p7 | at net.sf.ehcache.CacheManager.checkStatus(CacheManager.java:1626)
confluence-confluenceServer-p7 | at net.sf.ehcache.CacheManager.getEhcache(CacheManager.java:1161)
confluence-confluenceServer-p7 | at com.atlassian.confluence.cache.ehcache.EhCacheManager.wrapCache(EhCacheManager.java:162)
confluence-confluenceServer-p7 | at com.atlassian.confluence.cache.ehcache.EhCacheManager.getCache(EhCacheManager.java:257)
confluence-confluenceServer-p7 | at com.atlassian.confluence.cache.ehcache.EhCacheManager.getCache(EhCacheManager.java:42)
confluence-confluenceServer-p7 | at com.atlassian.confluence.impl.cache.DelegatingCacheManager.getCache(DelegatingCacheManager.java:101)
confluence-confluenceServer-p7 | at jdk.internal.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
confluence-confluenceServer-p7 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
confluence-confluenceServer-p7 | at java.base/java.lang.reflect.Method.invoke(Method.java:568)
confluence-confluenceServer-p7 | at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
confluence-confluenceServer-p7 | at com.atlassian.confluence.impl.cache.AbstractConfluenceCacheAspect.invoke(AbstractConfluenceCacheAspect.java:25)
confluence-confluenceServer-p7 | at jdk.internal.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
confluence-confluenceServer-p7 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
confluence-confluenceServer-p7 | at java.base/java.lang.reflect.Method.invoke(Method.java:568)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
confluence-confluenceServer-p7 | at com.atlassian.confluence.impl.cache.AbstractConfluenceCacheAspect.invoke(AbstractConfluenceCacheAspect.java:25)
confluence-confluenceServer-p7 | at jdk.internal.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
confluence-confluenceServer-p7 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
confluence-confluenceServer-p7 | at java.base/java.lang.reflect.Method.invoke(Method.java:568)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
confluence-confluenceServer-p7 | at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
confluence-confluenceServer-p7 | at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
confluence-confluenceServer-p7 | at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
confluence-confluenceServer-p7 | at jdk.proxy4/jdk.proxy4.$Proxy308.getCache(Unknown Source)
That’s odd. Is this preventing your app from working? Any stack trace? There must be something about the app that’s resolving as a transitive dependency on batik somewhere.
The AttachmentDao is an internal interface that should never have been exposed to plugins, and we’ve closed that loophole with 9.0. What are you trying to achieve?
We use it to set the creator and last modifier. Our app do bulk operations on attachments and users complained from losing the creator and last modifier info after that (all modified attachments are now created and modified by the user who run the bulk operation)
Is there another way to do so?
Note: Setting the creator and last modifier in the new version of the attachment is ignored by the AttachmentManager.
When the AttachmentManager persists an attachment to the database, it uses the user in AuthenticatedUserThreadLocal as the creator and last modifier in the new version.
As a work round, you might start a new thread, where setting a desired user in AuthenticatedUserThreadLocal, and then do your saving logic.
Thanks for all of your team’s work for upgrading atlasisan-pocketknife-dynamic-modules to work with 8.9.
It seems, unfortunately, that Confluence 9.0.0-m41 no longer works with v1.1.1 due to a banned dependency on com.atlassian.annotations.tenancy from within the pocketknife code.
Is it possible to fix either Confluence or atlasisan-pocketknife-dynamic-modules?
I’ll investigate whether we can remove the tenancy dependency from pocketknife altogether, remove the dependency ban in Confluence, or whether we’re hitting a brick wall here. I’ll report back when I know more.
Thanks for the quick response. Further testing shows that the above is not the only problem either: even after trying to patch out the banned annotation classes, I am getting java.lang.NoClassDefFoundError: com/atlassian/plugin/module/Dom4jDelegatingElement on plugin load.
If there is any opportunity to do a full test of functionality of the pocketknife on the latest 9.0 milestone, that would be greatly appreciated!
We’re working on this PR which should solve the problem with Dom4jDelegatingElement. It doesn’t deserve a beauty prize, but hopefully it’ll keep pocketknife in a state where it’s compatible across versions.