2021-02-26

org.hibernate.tool.schema.extract.spi.SchemaExtractionException: More than one table found in namespace





 




Caused by: org.hibernate.tool.schema.extract.spi.SchemaExtractionException: More than one table found in namespace (, ) : table_abc

...

...





https://stackoverflow.com/a/40243342


Check your database schema/s and your database user privileges;


Hibernate update mechanism may fail with this exception if there is a another database schema/user with the same table name, and the db user has the sufficient privileges to view this table.


So in your case, the table 'YYYYYYY' may be found in more than one database user/schema, and your db user has 'DBA' privileges.


To solve this you can either find and delete the ambiguous table or remove the user's redundant privileges.




Choose to go for: remove the user's redundant privileges.


Reset and change user privileges for user [job_service] using root.


REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user_abc';


GRANT ALL PRIVILEGES ON targeted_table.* TO 'user_abc'@'%' WITH GRANT OPTION;


FLUSH PRIVILEGES;



 

2021-02-22

Using: How to add local jar files to a Maven project?


Firstly, I would like to give credit for this answer to an anonymous Stack Overflow user - I am pretty sure I've seen a similar answer here before - but now I cannot find it.

The best option for having local JAR files as a dependency is to create a local Maven repository. Such a repository is nothing more than a proper directory structure with pom files in it.

For my example: I have my master project on ${master_project} location and subproject1 is on ${master_project}/${subproject1}.

Then I create a Maven repository in: ${master_project}/local-maven-repo.

In the pom file in subproject1 located at ${master_project}/${subproject1}/pom.xml, the repository needs to be specified which would take file path as a URL parameter:

<repositories>
    <repository>
        <id>local-maven-repo</id>
        <url>file:///${project.parent.basedir}/local-maven-repo</url>
    </repository>
</repositories>

The dependency can be specified as for any other repository. This makes your pom repository independent. For instance, once the desired JAR is available in Maven central, you just need to delete it from your local repo and it will be pulled from the default repo.

    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.servicebinder</artifactId>
        <version>0.9.0-SNAPSHOT</version>
    </dependency>

The last but not least thing to do is to add the JAR file to local repository using -DlocalRepositoryPath switch like so:

mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file  \
    -Dfile=/some/path/on/my/local/filesystem/felix/servicebinder/target/org.apache.felix.servicebinder-0.9.0-SNAPSHOT.jar \
    -DgroupId=org.apache.felix -DartifactId=org.apache.felix.servicebinder \
    -Dversion=0.9.0-SNAPSHOT -Dpackaging=jar \
    -DlocalRepositoryPath=${master_project}/local-maven-repo

Once the JAR file is installed, your Maven repo can be committed to a code repository, and the whole set-up is system independent. (Working example in GitHub).

I agree that having JARs committed to source code repo is not a good practice, but in real life, quick and dirty solutions are sometimes better than a full blown Nexus repo to host one JAR that you cannot publish.







20210409_am111914

Missing Artifacts

  1. After added repository in pom.xml

  2. After maven install by mvn script.



mvn script: 

mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file  \

-Dfile=/some/path/on/my/local/filesystem/felix.servicebinder-0.9-SNAPSHOT.jar \

-DgroupId=org.apache.felix -DartifactId=org.apache.felix.servicebinder \

-Dversion=0.9.0-SNAPSHOT -Dpackaging=jar \

-DlocalRepositoryPath=${master_project}/local-maven-repo

mvn install:install-file \

   -Dfile=<path-to-file> \

   -DgroupId=<group-id> \

   -DartifactId=<artifact-id> \

   -Dversion=<version> \

   -Dpackaging=<packaging> \

   -DgeneratePom=true




Might need to check if path separator issue:


from: /

<repositories>

<repository>

<id>EmbededMavenRepositories</id>

<url>file://${project.basedir}/src/main/resources/embeded_maven_repositories/</url>

</repository>

</repositories>



to: \



<repositories>

<repository>

<id>EmbededMavenRepositories</id>

<url>file://${project.basedir}\src\main\resources\embeded_maven_repositories\</url>

</repository>

</repositories>



Found it will copy the embedded maven repositories to your user/.m2 folder.






















Google Referrals