BootClassLoader Class not found and gradle failed in 52 seconds

Recently I try programming a Android Application on Android studio.
So here´s my problem:
when I try to deploy my apk to the AVD there is a popup

 Unfortunately, AppHeisl(the name of my application) has stopped

So I tried running the debugger and it shows me that the BootClassLoader throws a ClassNotFound Exception, because it couldn´t find the mainActivity.

So I looke for the error here and found this
After seeing i´d need to clean my project I looked up how to do that on android Studio. Turns out its simple: Opening the terminal in the root folder of the project and entering: gradlew clean
but when I try that I always get a error message:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'AppHeisl'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve
     Required by:
         project :
      > Could not resolve
         > Could not get resource ''.
            > Could not GET '  /com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
               > Connect to [] failed: Connection refused: connect
      > Could not resolve
         > Could not get resource ''.
            > Could not GET ''.
               > Connect to   [] failed: Connection refused: connect

SO my question is,
What actually is the bigger problem, and how to solve it, or preferably both

Glassfish 4.1 configure http/https proxy

To access external endpoints I have to go through proxy server. I have been trying to configure the http and https proxy in my glassfish 4.1 server but have had no success. I’ve tried adding the following sets of Java Options in my domain.xml – manually and through UI. But am still getting “Network is unreachable; nested exception is
Network is unreachable” error.


When I check the process (ps -ef | grep java) I can see the Java Options have been applied. I also need to implement http.nonProxyHosts ( something like -Dhttp.nonProxyHosts= *|localhost ) since some are internal endpoints and need to escape the proxy. But that’s the second battle. Any help on this would be very much appreciated.

getSymbol() in java.util.Currency returns different values depending on API level

The following code is being used to format a number in the proper currency:

public static String getFormattedCurrency(String currencyCode, String currencyName, Number value) {


    NumberFormat format = NumberFormat.getCurrencyInstance(Locale.getDefault());                                           
    Currency currency = Currency.getInstance(currencyCode);                                                   
    if (format instanceof DecimalFormat) {                                                                    
    Log.d("Currency", "Symbol: " + currency.getSymbol() + ", Currency: " + currency + ", Locale: " + local);          
    return format.format(value);

The value of currencyCode is THB, the Thai baht. On Lollipop, currency.getSymbol() returns ฿, the sign for the Thai baht. However, on Oreo, the same method returns THB.

Why are different values being returned between these two API levels?

in Javafx for the x-asxis turn time in seconds into a date

I’m trying to map data to time on javafx in a graph that keeps getting new info added.

problem is not being able to show dates on the x-asxis in a line graph in javafx.

so i am trying to use the epoch values to represent the dates (which works)
And then convert the relevant ticks on the graph to dates using setTickLabelFormatter to make it easier to read (which doesnt work so well).

            xAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(xAxis) {
            @Override public String toString(Number object) {

                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MMM-yyyy");

                System.out.println("converting time for graph "  + object);

                LocalDateTime dateTime =
                        LocalDateTime.ofInstant(Instant.ofEpochMilli(object.longValue() ), ZoneId.systemDefault());

                String formattedDateTime = dateTime.format(formatter); 

                System.out.println("populating graph with date " + formattedDateTime);
                return formattedDateTime;


The output i get is for the println is :

converting time for graph 0.0
populating graph with date 01-Jan-1970
converting time for graph 1.0E8
populating graph with date 02-Jan-1970
converting time for graph 2.0E8
populating graph with date 03-Jan-1970
converting time for graph 3.0E8
populating graph with date 04-Jan-1970
converting time for graph 4.0E8
populating graph with date 06-Jan-1970
converting time for graph 5.0E8
populating graph with date 07-Jan-1970
converting time for graph 6.0E8
populating graph with date 08-Jan-1970
converting time for graph 7.0E8
populating graph with date 09-Jan-1970
converting time for graph 8.0E8
populating graph with date 10-Jan-1970
converting time for graph 9.0E8
populating graph with date 11-Jan-1970
converting time for graph 1.0E9
populating graph with date 13-Jan-1970
converting time for graph 1.1E9
populating graph with date 14-Jan-1970
converting time for graph 1.2E9
populating graph with date 15-Jan-1970
converting time for graph 1.3E9
populating graph with date 16-Jan-1970
converting time for graph 1.4E9
populating graph with date 17-Jan-1970
converting time for graph 1.5E9
populating graph with date 18-Jan-1970
converting time for graph 1.6E9
populating graph with date 20-Jan-1970


Where am i going wrong and how could i convert the date in seconds since the epoch into a date displayed at the bottom of my graph?

Cannot find symbol in Java Programming

So my question is, that I’m getting the same error every time I want to compile with javac in my console. I searched on Internet and I could get some Informations but their weren’t helping much. I know that I don’t need that many packages but I was so frustrated about this error and so I did some more. They didn’t realy help… . I hope for fast support please. error: cannot find symbol
      symbol:   variable JOptionDialog
      location: class Zahlraten
    1 error

This is my code I have been writing, it is a little game were the programm picks a number out of 1 to 100 and you need to give the programm the correct number. If you do that you win. I apologize because the Messages in the Code are written in German.

    import javax.swing.*;
    import java.util.Random;
    import javax.swing.JOptionPane;
    import javax.swing.JFrame;
    import javax.swing.JPanel;

    public class Zahlraten {
        private int zufallszahl;
        private int ratezahl;

        Zahlraten() {
        short ratezahl = -1;

        void setZufallszahl(int zahl) {
        zufallszahl = zahl;

        int getZufallszahl() {
        return zufallszahl;

        void setRatezahl(int zahl) {
        ratezahl = zahl;

        int getRatezahl() {
        return ratezahl;

        public static void main(String[] args) {
        Zahlraten spiel = new Zahlraten();
        boolean geraten = false;
        int versuchzealer = 0;
                "Erraten Sie eine ganze Zahl aus dem Bereich von 1 bis 100!");
        Random randomGenerator = new Random();
        while (!geraten) {
                JOptionPane.showInputDialog("Welche Zahl wird gesucht?")));
        if (spiel.getRatezahl() < spiel.getZufallszahl()) {
                    JOptionPane.showMessageDialog(null, "Ihre Zahl ist zu klein!");
                } else {
            if (spiel.getRatezahl() > spiel.getZufallszahl()) {
                JOptionPane.showMessageDialog(null, "Ihre Zahl ist zu groß!");
            } else {
                geraten = true;
            "Glückwunsch! Sie haben die Zahl mit "
            + versuchzealer + " Versuchen erraten!"); 

Passing object from Activity to Fragment

I’m trying to pass object from Activity to Fragment. Object cannot be Parcelable or Serializable because it contains reference to socket I’m using for communication.

I created following solution:

//Fragment code
public void onAttach(Context context)
    if(!(context instanceof GameLogicSupplier))
        throw new IllegalStateException("Activity using this fragment must be GameLogicSupplier.");
    gameLogic = ((GameLogicSupplier) context).getGameLogic();

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    View view = inflater.inflate(R.layout.screen_players, container, false);

    playersAdapter = new PlayersAdapter(getActivity(), gameLogic.getPlayers());


    return view;


//Activity code
protected void onCreate(@Nullable Bundle savedInstanceState)


private void restoreRetainFragment()
    FragmentManager manager = getFragmentManager();
    fragmentRetain = (FragmentRetain) manager.findFragmentByTag(TAG_FRAGMENT_RETAIN);
    if(fragmentRetain == null) createRetainFragment(manager);
    else gameLogic = fragmentRetain.getLogic();

public GameLogic getGameLogic()
    return gameLogic;

In onCreate() activity takes my GameLogic from retain fragment(it cannot be destroyed on configuration changes). Then fragment is attached to activity, takes GameLogic object from activity(activity implements GameLogicSupplier interface) and uses it to initialize views.

However that method doesn’t work after configuration changes, because fragment’s onAttach() is called before activity’s onCreate() and GameLogic is null yet.
How can I solve it?

Android studio device monitor doesn’t open on mac?

My Android Studio version is 3.0.1 running JRE 1.8.0_152 on a Macbook Pro.

Every attempt at opening device monitor is followed by this error message:
Error message

Here is the error log:
Error log

I have just recently downloaded Android Studio with recommended settings so I’m not sure why it’s not functioning properly. I am using Java 9 for my system but for Android Studio, I am using its embedded JDK. So far, I have tried to:

  • Uninstalling and reinstalling Android Studio
  • Running device monitor with sudo command
  • Setting JDK’s path to Java 9 (which seems to be unsupported as Gradle could not sync)
  • Redownloading JDK with Homebrew

I could not find many solutions online for the Mac OS and the few I found did not work. Please help!

JMSWMQ2020: Failed to connect to queue manager

I’m trying to connect to queue manager using file.
Here is what I tried:

String CHANNEL_TABLE_PATH = "/usr/dev/";
URL chanTableUrl = new URL("file://"+ CHANNEL_TABLE_PATH);
MQQueueConnection connection = (MQQueueConnection) connectionFactory.createQueueConnection();

Here is what inside of my

Display Channel details.
   CHANNEL(C.TEST.1)                     CHLTYPE(CLNTCONN)
Display Channel details.
   CONNAME( )                              QMNAME( )

However, I did get the error on queue connection:
Exception in thread “main” java.lang.Exception: JMSWMQ2020: Failed to connect to queue manager ‘*’ with connection mode ‘Client’ and supplied CCDT URL ‘file:/use/test/’, see linked exception for more information.

I tried to change to: setQueueManager("*QUEMANAGER") or setQueueManager("*") or setQueueManager("QMGRNAME")
It returned same error. I also check ssl connection, it runs fine.

Also, I tried to connect to MQ server using this code and it works perfectly fine:

MQQueueConnection connection = (MQQueueConnection) connectionFactory_.createQueueConnection();

Does anyone know what went wrong and how to fix it?

ps: I did saw those posts: Connecting to IBM MQ using CCDT file in JMS