error: package org.picketlink.idm.internal does not exist - java

I changed my pom.xml to add picktlink-social so I changed my pom to remove picketlink-deltaspike, and addeda apache deltaspike because I had some redundancy issues with picktlink detlaspike, and for a while my app worked.
So every once in a while when I did a mvn clean, I got this error
ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project unikaimagen: Compilation failure: Compilation failure:
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[33,34] error: package org.picketlink.idm.internal does not exist
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[35,30] error: package org.picketlink.internal does not exist
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[70,9] error: cannot find symbol
[ERROR] symbol: class EEJPAContextInitializer
[ERROR] location: class IDMConfiguration
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[33,34] error: package org.picketlink.idm.internal does not exist
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[35,30] error: package org.picketlink.internal does not exist
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[70,9] error: cannot find symbol
[ERROR] symbol: class EEJPAContextInitializer
[ERROR] location: class IDMConfiguration
[ERROR] /home/jdc/git/unikaimagen/src/main/java/ec/com/unikaimagen/init/IDMConfiguration.java:[110,25] error: cannot find symbol
[ERROR] -> [Help 1]
So I changed the version of picketlink from 2.6.1 to 2.6.0 or 2.6.0 to 2.6.1 and it compiled again. But now that is not even working,
This is my pom.xml http://pastebin.com/9bRMrGkv.
org.picketlink.internal should be in picketlink-impl module, which is included in my pom.xml
This is my IDMConfiguration.java http://pastebin.com/XES0WyDQ
http://pastebin.com/XES0WyDQ
I did a jarscan and found this
$ java -jar jarscan.jar -d /home/jdc/.m2/repository/ EEJPAContextInitializer
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
+/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.0.Final/picketlink-impl-2.6.0.Final.jar
/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.0.Final/picketlink-impl-2.6.0.Final.jar/org/picketlink/internal/EEJPAContextInitializer.class
+/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.0.CR2/picketlink-impl-2.6.0.CR2.jar
/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.0.CR2/picketlink-impl-2.6.0.CR2.jar/org/picketlink/internal/EEJPAContextInitializer.class
+/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.1.Final/picketlink-impl-2.6.1.Final.jar
/home/jdc/.m2/repository/org/picketlink/picketlink-impl/2.6.1.Final/picketlink-impl-2.6.1.Final.jar/org/picketlink/internal/EEJPAContextInitializer.class
----------------------------------------------

I had the same problem when I updated the picketlink version. I checked your pom and I realized that it contains
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-api</artifactId>
</dependency>
which specifies all the dependencies, but you have also added each module separately. So, I think you should delete them and try again.

Related

Error while running maven command in gcp console unable to install common package error

unable to install apache maven packages in gcp console please let me know if any one resolves the issue. I'm trying to create dataflow pipeline following the below link
enter link description here
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.368 s
[INFO] Finished at: 2020-08-30T15:27:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project common: Compilation failure: Compilation failure:
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[78,12] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[80,30] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[29,42] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: package com.google.cloud.teleport.v2.utils
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[59,11] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.cdc.mappers.MergeInfoMapper
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :common
By now this is well known to developers bug, confirmed on my side, getting the same kafka-to-bigquery template compilation error around DataStreamClient class. Seems the new PR for CacheUtils.java is going to appear soon, more info here.

maven error for https://github.com/googleapis/java-translate

I am trying to get jar file for using google translation api for java. I downloaded pom.xml from https://github.com/googleapis/java-translate. Then type 'mvn install' got errors:
$ mvn install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module D:\googleTranslation\proto-google-cloud-translate-v3beta1 of D:\googleTranslation\pom.xml does not exist #
[ERROR] Child module D:\googleTranslation\proto-google-cloud-translate-v3 of D:\googleTranslation\pom.xml does not exist #
[ERROR] Child module D:\googleTranslation\grpc-google-cloud-translate-v3beta1 of D:\googleTranslation\pom.xml does not exist #
[ERROR] Child module D:\googleTranslation\grpc-google-cloud-translate-v3 of D:\googleTranslation\pom.xml does not exist #
[ERROR] Child module D:\googleTranslation\google-cloud-translate of D:\googleTranslation\pom.xml does not exist #
[ERROR] Child module D:\googleTranslation\google-cloud-translate-bom of D:\googleTranslation\pom.xml does not exist #
What I am missing? Any information would be appreciated. Thank you in advance.

Trying to compile inherited Java project and gettting errors with Maven build for third party libraries

I am fairly new to Java development, and I inherited a Java project. We are trying to recover some code from a decompiled JAR file.
I am trying to recompile it after making changes, and...
I am trying to compile it as such:
mvn clean compile process-classes
and I am getting the following errors:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project company-server: Compilation failure: Compilation failure:
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/net/sf/ehcache/search/attribute/ReflectionAttributeExtractor.java:[133,17] 'catch' without 'try'
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/net/sf/ehcache/search/attribute/ReflectionAttributeExtractor.java:[205,17] 'catch' without 'try'
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,87] illegal start of type
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,88] '(' or '[' expected
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,89] ';' expected
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,90] illegal start of type
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,105] ';' expected
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[40,145] <identifier> expected
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[43,45] ';' expected
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/hibernate/metamodel/source/hbm/TimestampAttributeSourceImpl.java:[51,6] illegal start of type
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java:[85,33] array dimension missing
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpec.java:[85,34] illegal start of expression
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/eclipse/jetty/io/WriteFlusher.java:[209,15] not a statement
[ERROR] /Users/name/Desktop/Projects/project-server-new/src/main/java/org/eclipse/jetty/io/WriteFlusher.java:[209,20] ';' expected
Etc etc.
I go to the location in question for one of the errors (this particular one is in fasterxml/jackson):
if (!baseType.isCollectionLikeType()) ** GOTO lbl25
Is this an artifact of the decompile process?
Sorry if this is a basic question - I'm not too familiar with Java, JARs or decompile processes.

SBT <project name> project refresh failed

Whenever I try to enable auto-import in IntelliJ it always gives me this error:
SBT 'mobile-aggregator' project refresh failed
Error:Error while importing SBT project:[error] at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:107)
[error] at sbt.io.Using.apply(Using.scala:22)
[error] at sbt.MainLoop$.runWithNewLog(MainLoop.scala:101)
[error] at sbt.MainLoop$.runAndClearLast(MainLoop.scala:57)
[error] at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:42)
[error] at sbt.MainLoop$.runLogged(MainLoop.scala:34)
[error] at sbt.StandardMain$.runManaged(Main.scala:113)
[error] at sbt.xMain.run(Main.scala:76)
[error] at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error] at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error] at xsbt.boot.Launch$.run(Launch.scala:109)
[error] at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error] at xsbt.boot.Launch$.launch(Launch.scala:117)
[error] at xsbt.boot.Launch$.apply(Launch.scala:18)
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error] at xsbt.boot.Boot$.main(Boot.scala:17)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.CreateTasks$
[error] Use 'last' for the full log.
[info] shutting down serverSee complete log in href="file:/C:/Users/Rahman/.IdeaIC2017.2/system/log/sbt.last.log">file:/C:/Users/Rahman/.IdeaIC2017.2/system/log/sbt.last.log
This happens quite a few times when your compiler / editor tries to use your cached project data.
To fix this, perform the following steps:
Exit IntelliJ & Delete .idea folder from the root project folder
Delete target folder from root_project_folder\target & root_project_folder\project\target
Make sure you have a valid name for your project name inside build.sbt. It should be in the following format: name := "projectname"
Again start your intelliJ and reinitialize your project.
Hopefully, that should have solved your problem

How to use 51Degrees.Mobi with Maven

I am trying to get 51Degrees.mobi to work with my Maven, JSF and Java project however I am having no luck so far. I have downloaded the 2 jars from http://51degrees.mobi/Support/Documentation/Java.aspx and followed the instructions. I now have a filter which looks like this
import fiftyone.mobile.detection.BaseDeviceInfo;
import fiftyone.mobile.detection.Provider;
import fiftyone.mobile.detection.binary.BinaryException;
import fiftyone.mobile.detection.binary.Reader;
public void doFilter(ServletRequest request, ServletResponse response,FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
String s = httpRequest.getHeader("user-agent");
//Create a Provider object
Provider p;
try {
p = Reader.create();
} catch (BinaryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//Provider p = Reader.create(PATH_TO_PREMIUM_DATA);
//Read in a HttpServletRequest or User Agent String
BaseDeviceInfo b = p.getDeviceInfo(s);
//Get the value of a property
String result = b.getFirstPropertyValue("IsMobile");
//Check the property value
if(result.equals("True")){
System.out.println("This is mobile");
}
if(result.equals("False")){
System.out.println("This is not mobile");
}
//Before exiting your application, ensure you dispose of the Provide to
//release it's resources such as it's thread pool
p.destroy();
}
Thats throws no errors. From looking online I have found the dependancy I must add to the pom file and I have it as such
<dependency><!-- Start 51Degrees.mobi dependencies -->
<groupId>mobi.51degrees</groupId>
<artifactId>detection</artifactId>
<version>2.1.15.1</version>
</dependency><!-- End 51Degrees.mobi dependencies -->
Again no errors are thrown in the file itself, however when I use mvn clean install in the directory I get the following error
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[18,32] error: package fiftyone.mobile.detection does not exist
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[19,32] error: package fiftyone.mobile.detection does not exist
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[20,39] error: package fiftyone.mobile.detection.binary does not exist
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[21,39] error: package fiftyone.mobile.detection.binary does not exist
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[45,4] error: cannot find symbol
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[47,7] error: cannot find symbol
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[50,11] error: cannot find symbol
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[60,4] error: cannot find symbol
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.730s
[INFO] Finished at: Wed Nov 14 12:45:35 GMT 2012
[INFO] Final Memory: 16M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default- compile) on project redirectionportal: Compilation failure: Compilation failure:
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[18,32] error: package fiftyone.mobile.detection does not exist
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[19,32] error: package fiftyone.mobile.detection does not exist
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[20,39] error: package fiftyone.mobile.detection.binary does not exist
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[21,39] error: package fiftyone.mobile.detection.binary does not exist
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[45,4] error: cannot find symbol
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[47,7] error: cannot find symbol
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[50,11] error: cannot find symbol
[ERROR]
[ERROR] \ea\portals\redirectionportal\src\main\java\com\filters\MyFilter.java:[60,4] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Anyone have any ideas?
As per the rules, I state that I work for 51Degrees.mobi as a Java developer. I am not sure from looking at the page at this time if you solved your problem? So I thought I would add some more information.
Firstly, If you have two Jar files then you are using 2.1.16.1 not 2.1.15.1, although this should not directly effect your problem I thought I would say for clarity :).
Also, 51Degrees.mobi's version 2.1.16.1 solution was recently made available via the maven central repository, after the current answers were posted. So now all you should have to do is add this dependency to your pom:
<dependency><!-- Start 51Degrees.mobi dependencies -->
<groupId>net.sourceforge.fiftyone-java</groupId>
<artifactId>51Degrees.mobi.detection.core</artifactId>
<version>2.1.16.1</version>
</dependency><!-- End 51Degrees.mobi dependencies -->
If you wished to use our second jar just replace "core" with "webapp".
Make sure you have 51Degrees.mobi in your repository (local or remote). I did a quick search in maven public repository and i cannot find it.
If the jar is in your local folder some where. You can use
mvn install:install-file -Dfile=your-artifact-1.0.jar \
[-DpomFile=your-pom.xml] \
[-Dsources=src.jar] \
[-Djavadoc=apidocs.jar] \
[-DgroupId=org.some.group] \
[-DartifactId=your-artifact] \
[-Dversion=1.0] \
[-Dpackaging=jar] \
[-Dclassifier=sources] \
[-DgeneratePom=true] \
[-DcreateChecksum=true]
check the link maven install plugin
Try to find the jar in your repository:
The jar should reside here:
~/.m2/repository/mobi/51degrees/detection/2.1.15.1/
If you find it there, check whether it contains the classes under package
fiftyone.mobile.detection
-- Update --
In case you don't find this jar, you can use one of the following options:
Use ''system'' scope dependency - it makes your build platform/environment dependent so I don't recommend it, although its the easiest way.
Use mvn install:install-file so that it will place your jar into your local maven repository. Its much better than the first method, but you still will need to use this command before running maven in each local environment / your local repository gets purged...
Maintain your own maven repository somewhere on server, map the maven to use this repository. This is by far the best approach I'm aware of. The best will be to work with repository proxies like 'Nexus' or 'Artifactory'. In the worst case you can create a repository as a plain file system and make it accessible through web server (like apache).
In this repository you'll be able to store thirdparty jars that don't exist in the public maven repository, your own artifacts, or maybe artifacts which are not free/opensource and therefor can't be maintained in the public maven repo (like commercial software that you can use).
Hope this helps

Categories