Package org.springframework.aop.framework does not exist - spring

I have installed grails and am trying to compile with the default version of cache:1.1.6 and I'm getting these errors within the plugin code.
Can any one help me with which dependency is broken in the repository - I havent even used the cache yet - just defined it in BuildConfig.groovy
I understand "By default, Grails will not only get the JARs and plugins that you declare, but it will also get their transitive dependencies" so why would I have to declare the dependencies?
Compilation error: startup failed:
Compile error during compilation with javac.
D:\Users\ve\.grails\2.4.0\projects\demo\plugins\cache-1.1.6\src\java\grails\plugin\cache\CustomCacheKeyGenerator.java:18: error: package org.springframework.aop.framework does not exist
import org.springframework.aop.framework.AopProxyUtils;
^
D:\Users\ve\.grails\2.4.0\projects\demo\plugins\cache-1.1.6\src\java\grails\plugin\cache\web\PageInfo.java:43: error: package org.springframework.aop does not exist
import org.springframework.aop.PointcutAdvisor;
^
D:\Users\ve\.grails\2.4.0\projects\demo\plugins\cache-1.1.6\src\java\grails\plugin\cache\web\PageInfo.java:44: error: package org.springframework.aop does not exist
import org.springframework.aop.TargetSource;

Odd this is with a new Grails application? It sounds like it could be a corrupt Maven cache issue. Try doing:
$ rm -rf ~/.m2/repository
Otherwise, to declare the dependency explicitly edit BuildConfig and add:
compile 'org.springframework:spring-aop:4.0.5.RELEASE'
To your dependencies block.

Related

mlUnittest is throwing error in MarkLogic

Mlunittest is throwing error while running as a gradle comment and I am getting below error
Local message: failed to read resource at resources/marklogic-unit-test: Internal Server Error. Server Message: RESTAPI-INVALIDREQ: (err:FOER0000) Invalid request: reason: Extension marklogic-unit-test or a dependency does not exist: XDMP-MODNOTFOUND: (err:XQST0059) Module /marklogic.rest.resource/marklogic-unit-test/assets/resource.xqy not found
I am using:
MarkLogic 9.0-12 version
Gradle 4.3.1
DHF 4.3.2
This error message suggests that the marklogic-unit-test libraries are not being loaded into the modules database correctly. If you're using ml-gradle to manage your modules you may want to double check your build.gradle file, specifically that marklogic-unit-test is configured as a dependency:
dependencies {
mlBundle "com.marklogic:marklogic-unit-test-modules:1.0.0"
}
You can check out a similar issue that was filed with the marklogic-unit-test and how it was resolved here: https://github.com/marklogic-community/marklogic-unit-test/issues/86
For a more complete example of a build.gradle file that imports marklogic-unit-test into a project check out the marklogic-unit-test project at https://github.com/marklogic-community/marklogic-unit-test#start-using-marklogic-unit-test.

BitBucket Server Maven error: The default package '.' is not permitted by the Import-Package syntax

I am developing a plugin for BitBucket Server. Today, the Maven instance started throwing the following error after I changed the scope of one dependency:
[ERROR] Manifest com.my-plugin:integrationPlugin:atlassian-plugin:0.1-DEV : The default package '.' is not permitted by the Import-Package syntax.
This can be caused by compile errors in Eclipse because Eclipse creates
valid class files regardless of compile errors.
The following package(s) import from the default package null
[ERROR] Error(s) found in manifest configuration
After I reverted the change, the error did not go away.
I have tried solutions described in other StackOverflow posts, but they did not help me, since:
I am not using Eclipse
I have all packages declared in all my class files
The Bundle tool has this error fixed already
The manifest I got from the Maven debugging output is:
[DEBUG] Final Manifest:
#-----------------------------------------------------------------------
Manifest-Version: 1.0
Atlassian-Build-Date: 2019-04-04T11:44:27+0000
Atlassian-Plugin-Key: com.my-plugin.integrationPlugin
Bnd-LastModified: 1554378274635
Build-Jdk: 1.8.0_191
Built-By: egta136
Bundle-ClassPath: .,META-INF/lib/commons-logging-1.2.jar,META-INF/lib/pd
fbox-2.0.14.jar,META-INF/lib/fontbox-2.0.14.jar,META-INF/lib/ij-1.52n.j
ar
Bundle-Description: This is the com.my-plugin:integrationPlugin plu
gin for Atlassian Bitbucket Server.
Bundle-DocURL: https://example.com
Bundle-ManifestVersion: 2
Bundle-Name: integrationPlugin
Bundle-SymbolicName: com.my-plugin.integrationPlugin
Bundle-Vendor: Example
Bundle-Version: 0.1.0.DEV
Created-By: Apache Maven Bundle Plugin
Export-Package: com.my-plugin.integrationPlugin.api;version="0.1.0"
Import-Package:
com.apple.eawt;version=0;resolution:=optional,
com.atlassian.bitbucket.auth;version=0;resolution:=optional,
com.atlassian.bitbucket.commit;version=0;resolution:=optional,
com.atlassian.bitbucket.project;version=0;resolution:=optional,
com.atlassian.bitbucket.user;version=0;resolution:=optional,
com.atlassian.plugin.spring.scanner.annotation.export;version=0;resolut
ion:=optional,
com.atlassian.plugin.spring.scanner.annotation.imports;version=0;resolu
tion:=optional,
com.atlassian.sal.api;version=0;resolution:=optional,
com.atlassian.sal.api.pluginsettings;version=0;resolution:=optional,
com.atlassian.soy.renderer;version=0;resolution:=optional,
com.dizainsync.ddm.integrationPlugin.api;version=0;resolution:=optional
,
com.fasterxml.jackson.databind;version=0;resolution:=optional,
com.google.common.collect;version=0;resolution:=optional,
javax.crypto;version=0;resolution:=optional,
javax.crypto.spec;version=0;resolution:=optional,
javax.imageio;version=0;resolution:=optional,
javax.imageio.metadata;version=0;resolution:=optional,
javax.imageio.plugins.jpeg;version=0;resolution:=optional,
javax.imageio.stream;version=0;resolution:=optional,
javax.inject;version=0;resolution:=optional,
javax.script;version=0;resolution:=optional,
javax.servlet;version=0;resolution:=optional,
javax.servlet.http;version=0;resolution:=optional,
javax.swing;version=0;resolution:=optional,
javax.swing.event;version=0;resolution:=optional,
javax.swing.table;version=0;resolution:=optional,
javax.swing.text;version=0;resolution:=optional,
javax.swing.text.html;version=0;resolution:=optional,
javax.swing.tree;version=0;resolution:=optional,
javax.tools;version=0;resolution:=optional,
javax.xml.namespace;version=0;resolution:=optional,
javax.xml.parsers;version=0;resolution:=optional,
javax.xml.xpath;version=0;resolution:=optional,
org.apache.avalon.framework.logger;version=0;resolution:=optional,
org.apache.commons.fileupload;version=0;resolution:=optional,
org.apache.commons.fileupload.disk;version=0;resolution:=optional,
org.apache.commons.fileupload.servlet;version=0;resolution:=optional,
org.apache.commons.io;version=0;resolution:=optional,
org.apache.commons.lang3;version=0;resolution:=optional,
org.apache.log;version=0;resolution:=optional,
org.apache.log4j;version=0;resolution:=optional,
org.bouncycastle.asn1;version=0;resolution:=optional,
org.bouncycastle.asn1.cms;version=0;resolution:=optional,
org.bouncycastle.asn1.pkcs;version=0;resolution:=optional,
org.bouncycastle.asn1.x500;version=0;resolution:=optional,
org.bouncycastle.asn1.x509;version=0;resolution:=optional,
org.bouncycastle.cert;version=0;resolution:=optional,
org.bouncycastle.cms;version=0;resolution:=optional,
org.bouncycastle.cms.jcajce;version=0;resolution:=optional,
org.slf4j;version=0;resolution:=optional,
org.w3c.dom;version=0;resolution:=optional,
org.xml.sax;version=0;resolution:=optional,
com.atlassian.plugin.osgi.bridge.external
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Spring-Context: *
Tool: Bnd-3.5.0.201709291849
#-----------------------------------------------------------------------
What could be causing this? It is especially weird since reverting the changes to pom.xml did not get rid of the error.
The error was caused by the ImageJ dependency that I had. Apparently some of their classes use the default package which does not play well with maven. Removing the dependency fixes the issue.
I had a similar issue. To find out which dependency may prevent OSGi packaging to work, review error message like Classes found in the wrong directory: {META-INF/versions/9/module-info.class=module-info}
Using jcfind to identify its origin, as an example:
./target/classes/META-INF/lib/classgraph-4.8.43.jar META-INF/versions/9/module-info.class
I am contacting parent POM provider to get this fixed.

Maven Project Library Not Found

I have maven project where i am adding the dependencies which are not resolvable as below.
My servlet is as follows:
LocaleUtil is getting resolve but its sub packages are throwing error when including.
I have tried invalidate cache and restart. But this didn't work for me.
Thanks,
The packages you are trying to import are internal, non-exported packages of the bundle com.adobe.granite.i18n. In fact, that bundle only exports the following packages:
Export-Package
com.adobe.granite.i18n {version=1.0, imported-as=[1.0.0,1.1)}
com.day.cq.i18n {version=5.4.0}
You should not attempt to use private packages of a library. Limit yourself to using only the exported API.

Hyperlegder Shim-client-1.0 Jar missing on complilation

Am trying to work with the Hyperlegder Java SDK but am unable to locate the Shim-client jar. See error below.
Information:java: Errors occurred while compiling module 'maven'
Information:javac 1.8.0_74 was used to compile java sources
Information:Module "maven" was fully rebuilt due to project configuration/dependencies changes
Information:16/07/2017, 3:08 PM - Compilation completed with 34 errors and 0 warnings in 14s 362ms
/Java/src/main/java/ZoneSDKInterface.java
Error:(11, 35) java: package org.hyperledger.fabric.shim does not exist
Error:(12, 35) java: package org.hyperledger.fabric.shim does not exist
All the sources i see online require me to download the source from a missing Git repo -≥ https://github.com/hyperledger/fabric/core/chaincode/shim/java
Edit: The source URL is https://github.com/hyperledger/fabric/tree/release/core/chaincode/shim/java
Was able to download the repo and gradle build to get the JAR file.
use bellow dependency
<dependency>
<groupId>me.reactiv.fabric-java-sdk</groupId>
<artifactId>fabric-java-sdk</artifactId>
<version>0.6.6</version>
</dependency>

how to include user defined package when do maven compile

Followed is my project structure.
com.company.univ.scheduler.api
--src
----com
-----company
-------univ
--------scheduler
----------api
------------annotation
---Column.java
---Id.java
---pom.xml
-------------model
----App.java
----job.java
----Task.java
----pom.xml
-------------service
----LockService.java
----ResultService.java
----TaskService.java
----pom.xml
Under model folder,the App.java will have to import annotation's java file.
Like
import com.company.univ.scheduler.api.Column;
import com.company.univ.scheduler.api.Id;
Likewise,all files distributed under various folder would be related.How would maven pom.xml handle this issue?
P.S When do maven compile,there always show error message like"can not find symbol;"
"method can not be override"..... I have checked those java files to the target line but no that obvious errors likely to happen,As our project was build in Ant before and all fine.
The maven compile info:
[ERROR] COMPILATION ERROR :
[INFO]-------------------------------------------------------
[ERROR] ..\com.company.univ.scheduler.api\src\com\company\univ\scheduler\api\model\Task.java:[7,50] package com.company.univ.scheduler.api doesnt exist
[ERROR] ..\com.company.univ.scheduler.api\src\com\company\univ\scheduler\api\model\Task.java:[8,50] package com.company.univ.scheduler.api doesnt exist [ERROR] ..\com.company.univ.scheduler.api\src\com\company\univ\scheduler\api\model\Task.java:[26,2] can not find symbol
symbol:class Column
location:class com.company.univ.scheduler.api.model.task
[ERROR] ..\com.company.univ.scheduler.api\src\com\company\univ\scheduler\api\model\Task.java:[22,2] can not find symbol
symbol:class Id
location:class com.company.univ.scheduler.api.model.task
Java source should be in src/main/java, which is the root of your package hierarchy.
I would strongly urge you to use the standard Maven directory layout.
Why are there pom files in each of your packages?

Resources