ssl – we are performing mysql crawling on 4 different client environments which has centos7 by upgrading maven dependecy jar version from 5.1.6 to 8.0.2

we are performing crawling on our four different client environments by upgrading maven dependecy jar version from 5.1.6 to 8.0.2.

As per below mysql link connection should be established to mysql server from client environment using ssl(i.e through SSL Handshake.)after upgrading to maven dependency jar version 8.0.2.

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-using-ssl.html

it is performing ssl handshake by using code itself for connecting to mysql server from 3 environments as expected and as per given in documentation.

But in one environment after upgrading to maven dependency jar version 8.0.2. it is not using ssl handshake to connect to mysql server rather it is connecting through jdbc url with username and password to connect to mysql server which was the case in previous version of maven dependency jar version 5.1.6.


mysql
mysql-connector-java
8.0.12

Steps Taken to trouble shoot the issue- we have downgraded the maven dependency jar version from 8.0.2 to5.1.6 and upgraded again to 8.0.2.
still it is asking for username and pass which is the case of lower maven dependency jar version 5.1.6.

Would any of you please guide us how to proceed further in order to trouble shoot this issue.

java – Is there a -f parameter for jar command?

I was preparing for the Java exam on the book OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide Exam 1Z0-815 2019 Boyarsky Selikoff

And I found the question:

Which options are valid on the jar command without considering module options?
With answer:

A. -c

B. -C

C. -cp

E. -f

I could not find such a parameter in the documentation

https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

If you know about the -f parameter and know what it does, write

java – Maven project using EclipseLink for persistence runs on IDE, but fails when running from a built jar

I’m working on a maven project using eclipselink 2.7.8 for persistence. When I run it on my IDE (Netbeans 12.0) it works perfectly well, but when I attempt to run it from a built jar it doesn’t.

This is the stack trace when I use the jar

Exception in thread "main" Local Exception Stack:
Exception (EclipseLink-30005) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader@2cdf8d8a
Internal Exception: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:129)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:118)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:191)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
        ...
Caused by: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2109)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2085)
        at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:104)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:107)
        ... 15 more
Caused by: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:233)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.hasEntity(MetadataProject.java:1441)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.isOneToMany(MetadataAnnotatedElement.java:693)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.buildAccessor(ClassAccessor.java:609)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessorFields(ClassAccessor.java:438)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessors(ClassAccessor.java:410)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.preProcess(ClassAccessor.java:1225)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EmbeddableAccessor.preProcess(EmbeddableAccessor.java:304)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1851)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:579)
        at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:629)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2006)
        ... 17 more

My persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
      <persistence-unit name="MyPersistenceUnit" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        ...
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:h2:./bd/MyPersistenceUnit"/>
            <property name="javax.persistence.jdbc.user" value=""/>
            <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
            <property name="javax.persistence.jdbc.password" value=""/>
            <property name="javax.persistence.schema-generation.database.action" value="create"/>
        </properties>
    </persistence-unit>
</persistence>

My pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    <groupId>xxxx.xxxxx</groupId>
    <artifactId>Service</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <properties>      
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.7.8</version>
        </dependency>
        
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.194</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>          
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
            <version>2.3.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>example</id>
                        <configuration>
                            <archive>
                                <manifest>
                                    <mainClass>xxxx.xxxxx.service.demonstration.MainDemo</mainClass>
                                </manifest>
                            </archive>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>

I suspect that it’s something to do with how maven is building the jar, since it works fine on the IDE. I have tried to utilize different eclipselink versions too, but that didn’t seem to help (I started this project using 2.5.2 but updated after I had problems due to incompatibilities with some Java 8 features)

jdk – Installed Oracle JDK8u121 on Ubuntu 20.10 but cant set .Jar Files to open with Java

Running Ubuntu 20.10 x64.
I installed Java 8 from this guide: https://www.javahelps.com/2015/03/install-oracle-jdk-in-ubuntu.html

I have downloaded and extracted the Java JDK 8u121 x64 tar file from Oracles site to /usr/lib/jvm
I updated the Environmental Variables and Path Variables following the same guide.
I have updated the alternatives list for java and javac as well for Ubuntu to recognize that it is installed, and it does recognize it.
Java version displays correctly.

Everything checks out. I can run jar files via the terminal but I cannot make .jar files executable and have them automatically run with java when I double click them. I also cannot find java in the list of other applications to open with.

Help Greatly Appreciated.

java – Pass external jar to Maven 3.2.5 install goal without modifying pom.xml

I have an old Eclipse Maven Project wich make use of JDK 1.6 and Maven 3.2.5.
The project is built with a set of existing Maven Run Configuration options.

I am in need of including an external .jar.
I know that the best option would be to add it as a dependency, but as I don’t want to modify the original pom.xml, I am looking for alternatives.

I have tried to add the jar as a classpath argument in the “Main” tab of Run Configurations panel with no luck.

The jar is also added to the project build path, and infact Eclipse is not showing any class compilation error. But Maven goal just fail as it’s not finding the class dependency.

mac – .jar file is not opening on 10.15.7 macOS Catalina

I have a JAR file, which is a program. I want to open this file, but when I double click the icon flashes for half-a-second but then nothing happens.
I tried to open via java -jar Downloads/launcher.jar, which returns this:

Error: Unable to initialize main class cr.riselauncher.Launcher
Caused by: java.lang.ClassFormatError: Illegal class name "/m/Dispatcher️" in class file yKMDW5EvDgdc44ye8WSaYWD53B9eVsAngQNDKLVRxnWyvkunYtFGb6p2cAYuyNtTJm4HJCGyVsb8E3TJWWzyfysdCjQGvJtFa3eXUqEj6fL8PvDedJD2EcP5yprg3B3EUWxg3eKD8CuFdd7rGG6ztcCL7qnEvspKwbCjM9tqCmuMX53evV69gZ2um3c5Q7FkgkSUyFJMCTLqHduc4SjWZYGN7WJcCjggZVFHxuaVGyURdyeLTQEGsax8dFP5mKjcm2bP8nGj2YC5Gey6TfgjhcEkeRgcpQzegYqH5Z5PfcjWxU2yRSMkjxFb8xMpAd9dvsE9PbynWEzrnpPRvw9YWYTpE7Sxw8DNMabQbhFK8MbLWfPcXVbc3TkPMDGWPvxLYWhGuFFEyFBMDmADEGcnuvWRHUaHUKBkpe7k7R4JyECw7uLHW79kfpsXqpXP6KAznrKK5qFQXGnaXFk2Vj3mmsBTZseb3Z3jwVPeAp62tdKFDG7qgc3CpnvWunhA2JqufjJuDgtKu9HB6427dVV7YyWCyKMuyQgvtrK7wyXqKZJYnwwKLhR3smRfnuPDVgY2TUdRmMSM2b6nDteEK4TpADsKFvHAUThYLQEtYb9UQs4gaQGmrp4FCP9qL6QuVeKxgrryzJZTezjhhfheckmnbekqwvseZJpQUvujzq5TsLHerz4CDzfjzGBBPaajVzaJD9Y5tnzHS26UNXnX3qJXBwNGfasVncLdfz6pFHSs4nFfqz92HtHsTq83w9h6yTP8gHeSPgwC4mCkGEwuNZkzyChF5nKvgruCr8SENNXrUhrb6uS33D3QgrvCkMy9qqHa97EE7DVRNdX8ZEhuwkuNs9qAxttjyaarAEtpmybDtDMzserHKqv4eSLLfGzVfHResxxqJZFE8SRr3ZGDkbVMUpnGSkBXjE7ht8rnQfpSpz2QstJ4HeFHJ9afhWRqLHd9vEpUY5MnHtu

So, I didn’t understand a lot from here, but, is it a code error, or is it because of my computer, I have the latest Java, the code is specified for a mac, maybe one of the files in the JAR is missing (cr.riselauncher.Launcher)?

MacBook Air (13-inch, Mid 2012), macOS Catalina 10.15.7

The recommended version of Java, Java 8 Update 281, 1.8.0_281

Only one Java installed on my Mac, not more

command line – How to set name for java -jar process and store pid to file

I would like to set name for process which triggers java -jar command. For example this command:

java -jar selenium-server-standalone-3.141.59.jar -role hub 

I would like to set this process name and store its pid to file. Like other services e.g. Apache has its name next to pid. But all java commands are named as java and it is useless. I found some scripts to store pid but it looks like it is super complicated. Thanks for any help.

dnd 3.5e – in D&D3.5, how do Magic Jar and Alter Self interact?

In D&D3.5, how do Magic Jar and Alter Self interact?

Suppose I am a normal human wizard, and I cast Magic Jar, then possess a huge zombie. Now I want to cast Alter Self. What are my options for picking a type? Which body changes?

Alter Self says, in relevant part:

You assume the form of a creature of the same type as your normal
form. The new form must be within one size category of your normal
size. The maximum HD of an assumed form is equal to your caster level,
to a maximum of 5 HD at 5th level. You can change into a member of
your own kind or even into yourself.

I’m ideally looking for a Rules-As-Written answer here, but any well-argued answer is good too.