lundi 11 mai 2015

IResourceChangeListener rename and set EditorPart name dynamically

IResourceChangeListener listens to changes in project workspace for example if the editor part file name has changed.

I want to know how to access that particular EditorPart and change its title name accordingly (e.g. with .setPartName), or maybe the refresh the editor so that it shows the new name automatically.

Ideal would be if the IResourceChangeListener has a Rename event type but does not seem to be the case.

Eclipse Android Game - Crashes when I hit Play

I've been following some tutorials online to try to get a grasp of basic android development, and I seem to be stuck. There are no errors in my code, but a few warnings and whenever I press play from the main menu, it crashes. If anyone could help out that'd be greatly appreciated!!

This is my MainActivity.java

package com.example.shadowassassinstu3;

import com.example.shadowassassinstu3.Game;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;


public class MainActivity extends Activity {

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void play(View v)
    {
        Intent i=new Intent(this,Game.class);
        startActivity(i);
    }

    public void exit(View v)
    {
        System.exit(0);
    }
}

This is my Game.java

package com.example.shadowassassinstu3;

import com.example.shadowassassinstu3.gameloop;
import com.example.shadowassassinstu3.Game.GameView;
import com.example.shadowassassinstu3.Game.TeleListener;
import com.example.shadowassassinstu3.R;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Bundle;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.view.Display;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.Window;
import android.view.WindowManager;

public class Game extends Activity {
    gameloop gameLoopThread;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //phone state
        TelephonyManager TelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        TelephonyMgr.listen(new TeleListener(),PhoneStateListener.LISTEN_CALL_STATE);
        //for no title
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(new GameView(this));     
    }

    public class GameView extends SurfaceView {
        Bitmap bmp,pause;
        Bitmap background;
        Bitmap run1;
        Bitmap run2;
        Bitmap run3;
        Bitmap exit;

        private SurfaceHolder holder;
        private int x = 0,y=0,z=0,delay=0,getx,gety;
        int show=0,sx,sy;
        int cspeed=0,kspeed=0,gameover=0;
        int score=0,health=100,reset=0;
        int pausecount=0,volume,power=0,powerrun=0,shieldrun=0;

        @SuppressWarnings("deprecation")
        @SuppressLint("NewApi")
        public GameView(Context context) 
          {
              super(context);

              gameLoopThread = new gameloop(this);
              holder = getHolder();

                 holder.addCallback(new SurfaceHolder.Callback() {
                @SuppressWarnings("deprecation")
                @Override
                public void surfaceDestroyed(SurfaceHolder holder) 
                {
                    gameLoopThread.setRunning(false);
                    gameLoopThread.getThreadGroup().interrupt();
                }

                @SuppressLint("WrongCall")
                @Override
                public void surfaceCreated(SurfaceHolder holder) 
                {
                      gameLoopThread.setRunning(true);
                      gameLoopThread.start();

                }
                @Override
                public void surfaceChanged(SurfaceHolder holder, int format,int width, int height) 
                        {

                        }
                });



                Display display = getWindowManager().getDefaultDisplay();

                sx = display.getWidth();
                sy = display.getHeight();;
                background = BitmapFactory.decodeResource(getResources(), R.drawable.back);
                run1=BitmapFactory.decodeResource(getResources(), R.drawable.run1);
                run2=BitmapFactory.decodeResource(getResources(), R.drawable.run2);
                run3=BitmapFactory.decodeResource(getResources(), R.drawable.run3);
                exit=BitmapFactory.decodeResource(getResources(), R.drawable.exit);
                pause=BitmapFactory.decodeResource(getResources(), R.drawable.pause);

                exit=Bitmap.createScaledBitmap(exit, 25,25, true);
                pause=Bitmap.createScaledBitmap(pause, 25,25, true);
                run1=Bitmap.createScaledBitmap(run1, sx/9,sy/7, true);
                run2=Bitmap.createScaledBitmap(run2, sx/9,sy/7, true);
                run3=Bitmap.createScaledBitmap(run3, sx/9,sy/7, true);
                background=Bitmap.createScaledBitmap(background, 2*sx,sy, true);

    }


     // on touch method

          @Override
            public boolean onTouchEvent(MotionEvent event) {

                if(event.getAction()==MotionEvent.ACTION_DOWN)
                {
                    show=1;

                    getx=(int) event.getX();
                    gety=(int) event.getY();

                // restart game
                if(getx>91&&gety<25)
                {
                    if(health<=0)
                    {
                        gameLoopThread.setPause(0);
                        health=100;
                        score=0;

                    }
                }
                //pause game
                if((getx>(sx-25)&&gety<25&&pausecount==0))
                {

                    gameLoopThread.setPause(1);
                    pausecount=1;
                }
                else if(getx>(sx-25)&&gety<25&&pausecount==1)
                {
                    gameLoopThread.setPause(0);
                    pausecount=0;
                }
            }

            return true;
        }


        @SuppressLint("WrongCall")
        @Override
        protected void onDraw(Canvas canvas) 
        {
            //background moving
            z=z-10;
            if(z==-sx)
            {
                z=0;
                canvas.drawBitmap(background, z, 0, null);

            }
            else
            {
                canvas.drawBitmap(background, z, 0, null);  
            }

            //running player 

         x+=5;
         if(x==20)
         {
             x=5;
         }

          if(show==0)
          {
              if(x%2==0)
              {
                  canvas.drawBitmap(run3, sx/16, 15*sy/18, null);

              }
              else 
              {
                  canvas.drawBitmap(run1, sx/16, 15*sy/18, null);

              }
          }

          canvas.drawBitmap(exit, 0, 0, null);
          canvas.drawBitmap(pause, (sx-25), 0, null);
        }
    }

    //phone state
    public class TeleListener extends PhoneStateListener 
    {
        public void onCallStateChanged(int state,String incomingNumber)
        {
            if(state==TelephonyManager.CALL_STATE_RINGING)
                {
                    System.exit(0);  
                }
        } 

    }
}

and this is my gameloop.java

package com.example.shadowassassinstu3;

import com.example.shadowassassinstu3.Game.GameView;
import android.annotation.SuppressLint;
import android.graphics.Canvas;

public class gameloop extends Thread {

    private GameView view;
    static final long FPS = 10;
    private boolean running = false;
       boolean isPaused;

    public gameloop(GameView view) {
          this.view = view;
    }

    public void setRunning(boolean run) {

          running = run;
    }

    public void setPause(int i)
    {
        synchronized (view.getHolder()) 
        {


            if(i==0)
            {
                isPaused=false;
            }
            if(i==1)
            {
                isPaused = true;
            }
         }
    }

    public void run() {
           long ticksPS = 100;
           long startTime = 0;
           long sleepTime;
              while (running) {
                  //pause and resume

                if (isPaused) 
                {
                      try 
                      {
                          this.sleep(50);
                      } 
                      catch (InterruptedException e) 
                      {
                        e.printStackTrace();
                      }
                }
                else
                {
                     Canvas c = null;
                     startTime = System.currentTimeMillis();
                     try {

                            c = view.getHolder().lockCanvas();

                            synchronized (view.getHolder()) 
                            {
                                view.onDraw(c);
                            }

                          } 
                     finally 
                     {
                         if (c != null) 
                            {
                                view.getHolder().unlockCanvasAndPost(c);
                            }
                     }
                   }
                     sleepTime = ticksPS-(System.currentTimeMillis() - startTime); 

                     try {

                            if (sleepTime > 0)
                               sleep(sleepTime);
                            else
                               sleep(10);
                        } 
                catch (Exception e) {}

              }

        }
}

A lot of the code I've gotten through watching tutorials and I really can't figure out what's wrong, if anyone could help I'd really appreciate it!

I think this is what you guys asked for:

05-11 10:23:51.966: D/AndroidRuntime(1894): Shutting down VM 05-11 10:23:51.966: D/AndroidRuntime(1894): --------- beginning of crash 05-11 10:23:51.966: E/AndroidRuntime(1894): FATAL EXCEPTION: main 05-11 10:23:51.966: E/AndroidRuntime(1894): Process: com.example.shadowassassinstu3, PID: 1894 05-11 10:23:51.966: E/AndroidRuntime(1894): java.lang.IllegalStateException: Could not execute method of the activity 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.view.View$1.onClick(View.java:4007) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.view.View.performClick(View.java:4756) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.view.View$PerformClick.run(View.java:19749) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.os.Handler.handleCallback(Handler.java:739) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.os.Handler.dispatchMessage(Handler.java:95) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.os.Looper.loop(Looper.java:135) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.ActivityThread.main(ActivityThread.java:5221) 05-11 10:23:51.966: E/AndroidRuntime(1894): at java.lang.reflect.Method.invoke(Native Method) 05-11 10:23:51.966: E/AndroidRuntime(1894): at java.lang.reflect.Method.invoke(Method.java:372) 05-11 10:23:51.966: E/AndroidRuntime(1894): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 05-11 10:23:51.966: E/AndroidRuntime(1894): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 05-11 10:23:51.966: E/AndroidRuntime(1894): Caused by: java.lang.reflect.InvocationTargetException 05-11 10:23:51.966: E/AndroidRuntime(1894): at java.lang.reflect.Method.invoke(Native Method) 05-11 10:23:51.966: E/AndroidRuntime(1894): at java.lang.reflect.Method.invoke(Method.java:372) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.view.View$1.onClick(View.java:4002) 05-11 10:23:51.966: E/AndroidRuntime(1894): ... 10 more 05-11 10:23:51.966: E/AndroidRuntime(1894): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.shadowassassinstu3/com.example.shadowassassinstu3.Game}; have you declared this activity in your AndroidManifest.xml? 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1761) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1485) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Activity.startActivityForResult(Activity.java:3736) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Activity.startActivityForResult(Activity.java:3697) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Activity.startActivity(Activity.java:4007) 05-11 10:23:51.966: E/AndroidRuntime(1894): at android.app.Activity.startActivity(Activity.java:3975) 05-11 10:23:51.966: E/AndroidRuntime(1894): at com.example.shadowassassinstu3.MainActivity.play(MainActivity.java:25) 05-11 10:23:51.966: E/AndroidRuntime(1894): ... 13 more 05-11 10:23:55.283: I/Process(1894): Sending signal. PID: 1894 SIG: 9

Is it ok to declare an object to be equal to itself in Javascript for the sake of refactoring a large project

I'm working on a very large javascript web app that doesn't really have a method to it. There seems to be an attempt to declare everything as part of a master object called "app". The original program existed as a single app.js file over 300k lines of code where the following was declared:

var app = {};

Beyond that everything in the app is written as such.

app.somefunction = function(args, callback) { 
    some code
};

This apparently allowed for the author to handily use Eclipse IDE "outline", which I confess I have started to enjoy having, never previously having been an IDE user I'm becoming a convert to the niceties they provide.

My question is, as I work on a phased refactor of this huge codebase, potentially trying to merge it into some sort of more established framework perhaps using something like require.js, is it OK to split the "app.js" up into smaller files and for the sake of sanity to be able to use the IDE outline declare app to be equal to itself in each one.

app = app;

I've tested this, it works from what I can tell and it allows the IDE to add all the subsequent functions to the outline window while making the project a little more manageable while I learn what it is actually doing. Are there any drawbacks to doing this? I imagine some async loading issues might occur; this could possibly add to client side overhead; or is this perfectly acceptable?

I realize that this is sort of a code philosophy question, but the simple Q&A would be, what effect would app=app; have?

Upgrade to JUnit 4 in Eclipse

I tried switching to JUnit 4 in Eclipse using the instructions in this answer: http://ift.tt/1IwEE3T.

It basically says to remove any JUnit 3 library in the build path (I removed a JUnit 3.7 jar) and add the JUnit 4 library, which I did.

However, when I run the following code in my test class:

import junit.runner.Version;
System.out.println("JUnit version is: " + Version.id());

I get:

JUnit version is: 3.8.1

I don't have any other JUnit libraries in my buildpath.

If it's relevant, the exact Eclipse version is "Indigo Service Release 1, Build id: 20110916-0149".

How can I fix this and run JUnit 4?

Android Application run in a real Mobile but not in Eclipse

My application run in my real mobile phone but not in Eclipse+Android Studio Enviroment. I check class and Android Manifest and are same. Whats wrong ?

My codes are:

1) MainActivity.java

package com.example.homework2;

import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends ActionBarActivity 
{
    EditText firstnameText;
    Button goButton, aboutButton;

    @Override
    protected void onCreate( Bundle savedInstanceState ) 
    {
        super.onCreate( savedInstanceState );       
        setContentView( R.layout.activity_main );       

        //firstnameText = ( EditText ) findViewById( R.id.editText1 );
        //String name = firstnameText.getText().toString();
/*      
        goButton =  ( Button ) findViewById( R.id.letsgo_button );
        goButton.setOnClickListener( new OnClickListener() 
        {
            @Override
            public void onClick( View v ) 
            {
                // TODO Auto-generated method stub
            }
        }); 
*/      
        aboutButton = ( Button ) findViewById( R.id.about_button );
        aboutButton.setOnClickListener( new OnClickListener() 
        {
            @Override
            public void onClick(View v) 
            {
                // TODO Auto-generated method stub
                Intent about = new Intent( MainActivity.this, About.class );
                startActivity( about );
            }           
        });
    }
}

2) activity_main.xml

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.homework2.MainActivity" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/editText1"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:scaleType="centerCrop"
        android:src="@drawable/wallpaper1" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="35dp"
        android:paddingTop="16px"
        android:paddingBottom="16px"
        android:background="#2B3856"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Enter your Name: "
        android:textColor="#E8E8E8"
        android:textStyle="bold" >

        <requestFocus />
    </EditText>

    <Button
        android:id="@+id/about_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/imageView1"
        android:layout_centerHorizontal="true"
        android:background="#101010"
        android:text="About"
        android:textColor="#F8F8F8"
        android:textStyle="bold" />

    <Button
        android:id="@+id/letsgo_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/about_button"
        android:layout_alignLeft="@+id/imageView1"
        android:layout_marginBottom="16dp"
        android:background="#3B0B0B"
        android:text="Let&apos;s GO !!!"
        android:textColor="#E8E8E8"
        android:textStyle="bold" />

</RelativeLayout>

3) About.java

package com.example.homework2;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;

public class About extends ActionBarActivity 
{   
    @Override
    protected void onCreate( Bundle savedInstanceState ) 
    {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.about );
    }
}

4) about.xml

   <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://ift.tt/nIICcg"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >


        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="463dp"
            android:layout_x="1dp"
            android:layout_y="-8dp"
            android:scaleType="centerCrop"
            android:src="@drawable/wallpaper2" />

        <EditText
            android:id="@+id/editText2"
            android:layout_width="match_parent"
            android:layout_height="209dp"
            android:layout_x="-1dp"
            android:layout_y="101dp"
            android:textColor="#FFFFFF"
            android:textStyle="bold|italic"   
            android:ems="10"
            android:gravity="center"
            android:text="Πριν δυο χρόνια ο Σερ Άλεξ Φέργκιουσον σταμάτησε την προπονητική. Η συγκεκριμένη εφαρμογή βάζει ένα κουίζ στους οπαδούς της ομάδας, για τα πεπραγμένα του Σκωτσέζου κόουτς στον πάγκο της Μάντσεστερ Γιουνάιτεντ." >

            <requestFocus />
        </EditText>
    </RelativeLayout>

5) AndroidManifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
    package="com.example.homework2"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".About"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.example.homework2.ABOUT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Java - JSON and Parent Shells

I'm kind of new to Java and programming some first programs using SWT GUI with Eclipse.

I got a few things I don't understand and will appreciate some explanations, preferably expanded to me the easiest way possible.

Can someone please tell me what is the best way for me to save a String ArrayList of properties after the program is shut down?

I was told to save it to a text file, and use JSON to read and write, but I could not understand how to do it. I need to be able to get this information from the user and save it for future use.

Is JSON the best way for my needs?

For example, I will need to save these information arrays:

folder: D:\Videos
buttonsPerLine: 7
labelLength: 75
menuButtonLength: 60
spaceFromLeft: 20
spaceFromTop: 20
Shows:
    brooklyn nine nine
    community
    the big bang theory
    the blacklist

and these:

linkArray1:
    www.youtube.com/1
    www.youtube.com/2
    www.youtube.com/3
linkArray2:
    www.youtube.com/1
    www.youtube.com/2
    www.youtube.com/3
linkArray3:
    www.youtube.com/1
    www.youtube.com/1

Thank you very much!

Can't launch the java program

I found this code on the site oracle but I can't launch with Eclipse it's saying me "Unable to launch". I have installed JDK 8 but it doesn't work...

Anybody have a solution please ? :p

public class SwingFX extends Application {

@Override
public void start (Stage stage) {
    final SwingNode swingNode = new SwingNode();

    createSwingContent(swingNode);

    StackPane pane = new StackPane();
    pane.getChildren().add(swingNode);

    stage.setTitle("Swing in JavaFX");
    stage.setScene(new Scene(pane, 250, 150));
    stage.show();
    }

private void createSwingContent(final SwingNode swingNode) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            swingNode.setContent(new JButton("Click me!"));
        }
    });
}
}

link to the website where I found the code : http://ift.tt/1Ffsv46

eclipse errors after java update [on hold]

I have just updated Java from a notification that came into my taskbar tray. Since the update Eclipse has brought up a variety of errors. Every line now has an error, I think it could be something to do with with Eclipse being unable to use the new update but I'm stumped as to what I can do to correct this.

I'm fairly new to Eclipse and Java so any help would be greatly appreciated.

The main error states "The error states the path was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project" I don't think Eclipse can locate the Java libraries, it states it can't resolve System or Scanner. All my classes have the same errors. I was using Java v1.8.42 previously then I did the update

Is it worth reinstalling it?

Hibernate production use warning

This warning comes up evertime i use hibernate.

Mai 11, 2015 3:42:20 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)

Do i have to be worried about this? The tables are created without problem, but this warning makes me unsure about my hibernate.cfg.xml configuration file.

Thx in advance for your support.

Making a list of all combinations of 2 letters and 4 numbers

I have been trying to create a code that can make a list of all combinations of 2 letters and 4 numbers

EX: aa1111, ab1111

the only thing that i can come up with are programs that print combinations that are against my outline

EX: aatc9e, gj3ru7

What can I do that makes it so it stops at two letters and goes to the four numbers?

Playframework create eclipse project

I am use play version i can not create eclipse project playframework via command line, i get next errors. I am use activator version 1.3.2; java -version 1.8 and javac -version 1.6. How solved my problem?

[myProject] $ eclipse
[info] About to create Eclipse project files for your project(s).
[info] Updating {http://file:/D:/activator-1.3.2-minimal/myProject/}root...
[info] Resolving org.scala-lang#scala-library;2.11.1 ...

[myProject] $ eclipse
[info] About to create Eclipse project files for your project(s).
[info] Updating {http://file:/D:/activator-1.3.2-minimal/myProject/}root...
[info] Resolving org.scala-lang#scala-library;2.11.1 ...
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:3: error: package play does not exist
[error] import play.*;
[error] ^
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:4: error: package play.mvc does not exist
[error] import play.mvc.*;
[error] ^
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:8: error: cannot find symbol
[error] public class Application extends Controller {
[error]                                  ^
[error]   symbol: class Controller
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:10: error: cannot find symbol
[error]     public static Result index() {
[error]                   ^
[error]   symbol:   class Result
[error]   location: class Application
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ReverseAssets.class: warning: Cannot find annotation method 'bytes(
)' in type 'ScalaSignature': class file for scala.reflect.ScalaSignature not found
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ReverseApplication.class: warning: Cannot find annotation method 'b
ytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\javascript\ReverseAssets.class: warning: Cannot find annotation met
hod 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\javascript\ReverseApplication.class: warning: Cannot find annotatio
n method 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ref\ReverseAssets.class: warning: Cannot find annotation method 'by
tes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ref\ReverseApplication.class: warning: Cannot find annotation metho
d 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\views\html\index.class: warning: Cannot find annotation method 'bytes()' in typ
e 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:11: error: cannot access Html
[error]         return ok(index.render("Your new application is ready."));
[error]                               ^
[error]   class file for play.twirl.api.Html not found
[error] 5 errors
[error] 7 warnings
[error] (compile:compile) javac returned nonzero exit code
[error] Could not create Eclipse project files:
[error] Error evaluating task 'dependencyClasspath': error

Is there a way that IntelliJ generates GUI designer code that is usable in Eclipse?

I already tried the option to generate the designer code into the *.java files but this is not the complete code. Is there any other way to do that? Thank you for your help.

Google Play Services running on Emulator

Adding Google Play Services lib (v.7327000) to my app, it works well on real devices but Activity crashes and I get error on running emulator (Google API 21/22, tried Nexus4/5/10) like this:

"E/OpenGLRenderer(2560): Could not allocate texture for layer (fbo=1 2560x1326)"

Tried with Android Studio (selective lib) and Eclipse (library project). Does anyone know a solution ?

Advice defined has not been applied

I have a AspectJ - Project with a aspect to making some System.out.println's to learning a little bit about aspects etc.

The Problem is, that the advices which i define to the cuts doesn't work. The warning which is shown is: advice defined in ShapeAspect has not been applied [Xlint:adviceDidNotMatch]

I'm working with a Mac OS X 10.10 Yosemite, Eclipse Luna Service Release 2 (4.4.2) and AspectJ Runtime: org.aspectj.runtime_1.8.5.20150128171000.jar, for the LTW classes etc.: org.aspectj.weaver_1.8.5.20150128171000.jar and additionally org.aspectj.ajde_1.8.5.20150128171000.jar.

My simple defined aspect:

public aspect ShapeAspect {
   // pointcuts
   pointcut myPointcut2() : execution(oldshape.Point.new(..));

  // advices
  before() : myPointcut2(){
    System.out.println("Before init.");
  }
}

But at the line of before().. is the Warning: advice defined in ShapeAspect has not been applied [Xlint:adviceDidNotMatch]

What is the Problem here? On my PC with Windows it works correctly?

Titan IllegalArgumentException:Could not instantiate implementation:com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager

I'm a beginner with Titan Graph Database and I'm just trying to create a simple titan graph in a particular path using eclipse.Initially , setting the titan configurations followed by creating two vertices and an edge. This is the code i had given :

public class TitanGraphDemo {
        private static final String TITAN_DB = "target/tmp/titan";
        private static final Logger logger = LoggerFactory.getLogger(TitanGraphDemo.class);
        public static void init() {
            Configuration  conf = new BaseConfiguration();
            conf.setProperty("storage.directory", TITAN_DB);
            conf.setProperty("storage.backend","cassandra");
            conf.setProperty("storage.hostname","127.0.0.1");
            conf.setProperty("storage.port","9160");
            TitanGraph graph = TitanFactory.open(conf);

            Vertex rash = graph.addVertex(null);
            rash.setProperty("userId", 1);
            rash.setProperty("username", "rash");
            rash.setProperty("firstName", "Rahul");
            rash.setProperty("lastName", "Chaudhary");
            rash.setProperty("birthday", 101);

            Vertex honey = graph.addVertex(null);
            honey.setProperty("userId", 2);
            honey.setProperty("username", "honey");
            honey.setProperty("firstName", "Honey");
            honey.setProperty("lastName", "Anant");
            honey.setProperty("birthday", 201);

            Edge frnd = graph.addEdge(null, rash, honey, "FRIEND");
            frnd.setProperty("since", 2011);
            graph.commit();
            logger.info("Titan graph loaded successfully.");
        }
    }

But when i run the java, i am getting IllegalArgumentException as below.

Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)
    at com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:421)
    at com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:361)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1275)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:93)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:73)
    at titan.TitanGraphDemo.init(TitanGraphDemo.java:37)
    at titan.TitanGraphDemo.main(TitanGraphDemo.java:113)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)
    ... 7 more
Caused by: java.lang.NoSuchMethodError: com.netflix.astyanax.impl.AstyanaxConfigurationImpl.setTargetCassandraVersion(Ljava/lang/String;)Lcom/netflix/astyanax/impl/AstyanaxConfigurationImpl;
    at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.getContextBuilder(AstyanaxStoreManager.java:474)
    at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.<init>(AstyanaxStoreManager.java:267)
    ... 12 more

I have added the dependencies for titan, cassandra. Please anyone guide me with this issue.

Details of dependencies added in pom.xml is as below :

<!-- Libraries -->
    <dependencies>
        <!-- TinkerPop -->
        <dependency>
            <groupId>com.tinkerpop.blueprints</groupId>
            <artifactId>blueprints-core</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>com.tinkerpop.blueprints</groupId>
            <artifactId>blueprints-test</artifactId>
            <version>2.6.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.tinkerpop.gremlin</groupId>
            <artifactId>gremlin-groovy</artifactId>
            <version>2.1.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>gossip</artifactId>
                    <groupId>org.sonatype.gossip</groupId>
                </exclusion>
            </exclusions>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.tinkerpop.rexster</groupId>
            <artifactId>rexster-core</artifactId>
            <version>2.1.0</version>
        </dependency>
        <!-- Utility -->
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>12.0</version>
        </dependency>
        <dependency>
            <groupId>colt</groupId>
            <artifactId>colt</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode</groupId>
            <artifactId>kryo</artifactId>
            <version>1.04</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
          <groupId>org.objenesis</groupId>
          <artifactId>objenesis</artifactId>
          <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax</artifactId>
            <version>1.0.6</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.6</version>
        </dependency>
       <!--  <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
        </dependency> -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>


        <!-- Storage backends -->
        <!-- HBase -->
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase</artifactId>
            <!-- Update the hadoop-core artifact version when you update this -->
            <version>0.94.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>avro</artifactId>
                    <groupId>org.apache.avro</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jruby-complete</artifactId>
                    <groupId>org.jruby</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <!-- Update the hbase artifact version when you update this -->
            <version>1.0.3</version>
        </dependency>
        <!-- Cassandra -->
       <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.5.5</version>
        </dependency>
        <!-- BerkeleyDB -->
        <dependency>
            <groupId>com.sleepycat</groupId>
            <artifactId>je</artifactId>
            <version>5.0.58</version>
        </dependency>


        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-core</artifactId>
            <version>0.5.4</version>
        </dependency>
        <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-cassandra</artifactId>
            <version>0.5.0</version>
        </dependency>
         <dependency>
            <groupId>com.thinkaurelius.titan</groupId>
            <artifactId>titan-all</artifactId>
            <version>0.5.0-M1</version>
        </dependency> 

        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>2.0.0-beta2</version>
        </dependency>
    </dependencies>

Wrong .classpath generated for multimodule project by maven-eclipse-plugin

My project has the following structure:

/ProjectRoot
/ProjectRoot/A
/ProjectRoot/B
/ProjectRoot/C

ProjectRoot is a multimodule project. Project A should create war and it has dependencies to projects B and C delared in its pom. When I run maven eclipse:eclipse on ProjectRoot it results in incorrect .classpath file created for project A.

<classpath>
  <classpathentry kind="src" path="/B"/>
  <classpathentry kind="src" path="/C"/>
</classpath>

This stops the build in eclipse. Problems tabs displays:

Project 'A' is missing required Java project: 'B'
Project 'A' is missing required Java project: 'C'
The project cannot be built until build path errors are resolved

I know I can fix this problem manually(Properties/Build path/Projects remove the missing ones and then add them once again) but I would like to have the correct settings generated automatically by maven-eclipse-plugin.

Details of Nebula Nattable filtering

It looks as though implementing filter function in Nebula Nattable is difficult. Even the example given is hard to understand. would someone point to an explanation on the various classes used in implementing the filter function ?

Checkstyle validation fail when needs multiple lines

I need to perform a validation rule on eclipse checkstyle, after a key { of method and before end key } should have a empty line, example:

public void wrongMethod() {
    System.out.println("wrong method");
}

correct

public void correctMethod() {

    System.out.println("correct method");

}    

I try to use a RegexpMultiline in checkstyle rules xml file, doing some like this:

<module name="RegexpMultiline">
    <property name="format" value=".+\{\n.+[;]"/>
    <property name="message" value="should have empty line"/>
</module>  

sure, this Regex expression can be better, the issue is, the multiline behavior works in a regex simulator site with the examples above, but in checkstyle dont. I search on a checkstyle documentation and not found a ready reature for this.

Anyone know a solution for this issue?

thanks.

Rename resource file does not change editor part title

In my plugin project, I have a project explorer view where I can rename a config file which in shown in another editor part. The file can be renamed in the explorer with the rename resource dialog but the corresponding the editor tab title does not change. The same problem is described here and also here. Is there a standard way to get the rename functionality working without the creating a custom listener?

Can install RadRails on Eclipse Luna 4.4.2

I am trying to install the RadRails plug-in on a fresh Eclipse Luna instance (4.4.2), using the following update site: http://ift.tt/KNKjIh

But it always fails with the error below:

Cannot complete the install because one or more required items could not be found. Software being installed: Aptana RadRails 2.0.5.1278709071-79-7D7BFZcLCUQRF2NWAQhRBC1qP (com.aptana.radrails.feature.feature.group 2.0.5.1278709071-79-7D7BFZcLCUQRF2NWAQhRBC1qP) Missing requirement: Aptana Editor Infrastructure 2.0.5.1278523018-8o57z9icbz-hWlJZG (com.aptana.ide.feature.editors.feature.group 2.0.5.1278523018-8o57z9icbz-hWlJZG) requires 'org.eclipse.update.ui 0.0.0' but it could not be found

Cannot satisfy dependency: From: Aptana Web Development Tools 2.0.5.1278614541-7D-7O7iRJci-jVhz-KFyoijH (com.aptana.ide.feature.feature.group 2.0.5.1278614541-7D-7O7iRJci-jVhz-KFyoijH) To: com.aptana.ide.feature.editors.feature.group [2.0.5.1278523018-8o57z9icbz-hWlJZG] Cannot satisfy dependency: From: Aptana RadRails 2.0.5.1278709071-79-7D7BFZcLCUQRF2NWAQhRBC1qP (com.aptana.radrails.feature.feature.group 2.0.5.1278709071-79-7D7BFZcLCUQRF2NWAQhRBC1qP) To: com.aptana.ide.feature.feature.group [2.0.5.1278614541-7D-7O7iRJci-jVhz-KFyoijH]

What should I do to install RadRails?

How do I run test cases for a class written in Java, using Robot framework?

I am trying to learn how to use Robot Framework. I created simple Java project, using Eclipse. It contains one package - test and in this package there is only one class - MyKeywords. Here is the class content:

package test;

public class MyKeywords {

    public String sayHi(String name)
    {
            return "Hello " +name ;
    }

    public String sayHi()
    {
            return "Hello World!";
    }

    public String typeOf(Object param)
    {
            return param.getClass().getSimpleName();
    }
} 

Then I created simple .txt file, whic is supposed to contain the test cases. Here is the my_suite.txt file:

*** Settings ***
Library           test.MyKeywords

*** Test Cases ***
MyTestCase
    ${message}    say hi
    Log    ${message}

MyTestCase2
    ${message}    say hi    my_name
    Log    ${message}

MyTestCase3
    ${message}    type of    42
    Log    ${message}

Whenever, I try to paste the my_suite.txt file into the project directory, it goes under the bin directory. After that, when I run pybot my_suite.txt from the terminal (I am on Mac OS), I got the following message:

[ ERROR ] Error in file '/Users/b18/Documents/workspace/Example/my_suite.txt': Importing test library 'test.MyKeywords' failed: Module 'test' does not contain 'MyKeywords'. ============================================================================== My Suite

============================================================================== MyTestCase
| FAIL | No keyword with name 'say hi' found. ------------------------------------------------------------------------------ MyTestCase2
| FAIL | No keyword with name 'say hi' found. ------------------------------------------------------------------------------ MyTestCase3
| FAIL | No keyword with name 'type of' found. ------------------------------------------------------------------------------ My Suite
| FAIL | 3 critical tests, 0 passed, 3 failed 3 tests total, 0 passed, 3 failed ============================================================================== Output: /Users/b18/Documents/workspace/Example/output.xml Log:
/Users/b18/Documents/workspace/Example/log.html Report: /Users/b18/Documents/workspace/Example/report.html

Where is my mistake and what am I missing?

C++ - getline stdin EOF not working

I'm new to C++ and I'm working on a basic C++ project.

I have some lines of text (with whitespace in them) that I want to make the program accept from standard input and then stop when it encounters a (simulated) EOF because of a Ctrl + D.

I've looked up and tried the solutions given here and here. They work ie the code in the while loop stops executing after I hit Ctrl + D but for some reason the following lines of code do not get executed.

I've tried various ways to do this but I keep getting the same problem.

string line;
int i = 0;
while (true) {
    if (getline(cin, line)) {
        A[i] = line;
        cout << A[i] << endl; //executes as expected
        i++;
    } else {
        break;
    }
}
cout << "exited" << endl; //not executed even after ctrl+d

Here's another method I tried:

string line;
int i = 0;
while (getline(cin, line)){
    //cin.ignore();
    A[i] = line;
    cout << A[i] << endl; //executes as expected
    i++;

}
cout << "exited" << endl; //still not executed


Sample input:

DUCHESS 26
MARIE 8
BERLIOZ 8
TOULOUSE 7
THOMAS 28


PS: I use Eclipse CDT on Ubuntu.

Thanks in advance for any help you can offer.

Setting up play framework and dart for development and debug

I'm developing a relatively simple web app using play framework for the server and dart for the client. I'm using eclipse. Development and debug are fine on their own but how do to get them to work together?

Play has its own web server (activator) that knows how to load the entry points for each endpoint and the dart environment know how to serve up dart resources (pub serve) for dartium and (haven't tried this yet) serve js resources for other browsers. It there a way for activator to ask the dart/pub system for resources as needed?

I tried adding a symlink from the server static resource directly to to the dart/html resources but it seems these files need to be processed by pub server before they can be used by the browser.

Thanks, Evan.

Eclipse RCP: is there a refresh interval for views?

I have a problem with Talend (built with Eclipse RCP): the SVN is checked every second for new files. After having a look at Talend files, I had isolated a view (class RepoRefreshAction) which seems to update SVN.

I wonder if it is possible that an Eclipse RCP view has a default refresh interval of one second, and if this delay could be changed ?

LibVLC vlcjni library

I want to make a media player using libVLC on Android. When I launch my application, it makes me Can't load vlcjni library: java.lang.UnsatisfiedError:Couldn't load vlcjnilibrary... findlibrary returned null

I am using eclipse and android ndk path is already set.

I have all the .so files in jni/libs/armeabi-v7a.

I still didn't find the solution on the net... Did I miss something on project configuration ? Help me please ! Thanks !

SWTBot - why can't run the same class using JUnit4TestAdapter?

I'm using SWTBot to run automation on my enviroment. I've created 2 Suites and 2 test cases in each - the problem is that I used the same Test case for both suites.

TestSuite suite = new TestSuite("Test Suite 1");
suite.addTest(new JUnit4TestAdapter(Test1.class));
suite.addTest(new JUnit4TestAdapter(Test2.class));

TestSuite suite = new TestSuite("Test Suite 2");
suite.addTest(new JUnit4TestAdapter(Test1.class));
suite.addTest(new JUnit4TestAdapter(Test2.class));

when I run the SWTBot, it runs only one suite twice.. see my code here:

AllTestSuites.java - Main class which build all suites

@RunWith(Suite.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@SuiteClasses({
    SuiteOneAllTests.class, 
    SuiteTwoAllTests.class })
....//Code..

SuiteOneAllTests.java

public class SuiteOneAllTests extends TestSuite {

    /**
     * Function for running all test cases
     * @return suite (All test cases)
     * @throws Exception 
     */
    public static Test suite() throws Exception {
    TestSuite suite = new TestSuite("Test Suite 1");

        suite.addTest(new JUnit4TestAdapter(Test1.class));
        suite.addTest(new JUnit4TestAdapter(Test2.class));

        return suite;
    }
}

SuiteTwoAllTests.java

public class SuiteTwoAllTestsextends TestSuite {

    /**
     * Function for running all test cases
     * @return suite (All test cases)
     * @throws Exception 
     */
    public static Test suite() throws Exception {
    TestSuite suite = new TestSuite("Test Suite 1");

        suite.addTest(new JUnit4TestAdapter(Test1.class));
        suite.addTest(new JUnit4TestAdapter(Test2.class));

        return suite;
    }
}

And here is the results: http://ift.tt/1Ff49HD

Error in Assigning proper home directory while configuring jboss-eap-6.4 server in Eclipse Luna

when adding a jboss-eap-6.4 version server in Eclipse luna, i added the below home directory. D:\jboss-eap-6.4.0\jboss-eap-6.4:

which contains all the subfolders (bin, bundles, docs, domain,modules, standalone etc).

But I am getting error : 'User must select a valid configuration'

If I am starting the server using command prompt it's happening properly.

D:\jboss-eap-6.4.0\jboss-eap-6.4\bin>standalone.bat -c standalone-full.xml I am using jre6 in eclipse

Please advice.

I am having problems building a project using ant build from the command line on one system, but it works on antoher

I am having problems building a project using ant build from the command line on one system, but it works on antoher.

The Java version is 1.7 on both systems. I don't have Eclipse on the system on which it doesn't work.

So, I wonder if ant build uses something from Eclipse while doing ant build, even if I run it from the command line.

Continuous connection/disconnection between my PC and Android phone

I am trying to build Android apps using Eclipse, I am using Sony Xperia Z3 compact to test the apps. Whenever I connect my device to the PC it keeps getting connected then disconnected continuously almost each half a second, which makes it impossible for me to run my apps on it.

I spent much time looking throw the web for a solution but unfortunately I had no luck, for example, here they are solving the problem when the phone isn't recognized only by Eclipse, but my problem is quite different.

I also tried with Xperia Z and got the same problem. My USB debugging mode is enabled and I am using the Mass Storage mode (MSC).

Any help is highly appreciated.

How to use linkedin component Camel

I would really appreciate if someone could give me an example on how to use the camel LinkedIn component. I am trying to make a LinkedIn route builder, but I haven't figured out how to use the application details received from LinkedIn developer (application name, api key, secret key...). I am using Java DSL

Thank you in advance!

Eclipse - Package Naming Issue

Really quick question, once i've deleted a package in eclipse. How do i add a package with the same name. I get the "A resource exists with a different case" error. Is there a way to do this or do i have to make another package by a different name?

Many thanks.

Liferay Project Build Failed

I am trying to create a new theme plugin project in Eclipse using Liferay IDE but getting a Build Failed Error.

Eclipse logs says this

    !SESSION 2015-05-11 12:36:37.793 -----------------------------------------------
eclipse.buildId=4.4.0.I20140606-1215
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.egit.ui 2 0 2015-05-11 12:38:55.389
!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level
Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory.
The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in
this system level configuration. The Git installation location can be configured on the
Team > Git > Configuration preference page's 'System Settings' tab.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.egit.ui 2 0 2015-05-11 12:38:55.390
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Pawan'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.apache.ivyde.eclipse 1 0 2015-05-11 12:40:03.667
!MESSAGE starting IvyDE plugin

!ENTRY org.apache.ivyde.eclipse 1 0 2015-05-11 12:40:03.680
!MESSAGE IvyDE plugin started

!ENTRY com.liferay.ide.project.core 4 0 2015-05-11 14:30:49.541
!MESSAGE Error creating Liferay plugin project.
!STACK 1
org.eclipse.core.runtime.CoreException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431334488475' does not exist
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:182)
    at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:109)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOp$Impl.execute(Unknown Source)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard.performFinish(SapphireWizard.java:370)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard$3.run(SapphireWizard.java:334)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.io.FileNotFoundException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431334488475' does not exist
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1298)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1191)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1160)
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:176)
    ... 6 more
!SUBENTRY 1 com.liferay.ide.project.core 4 0 2015-05-11 14:30:49.542
!MESSAGE Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431334488475' does not exist
!STACK 0
java.io.FileNotFoundException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431334488475' does not exist
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1298)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1191)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1160)
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:176)
    at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:109)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOp$Impl.execute(Unknown Source)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard.performFinish(SapphireWizard.java:370)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard$3.run(SapphireWizard.java:334)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

!ENTRY com.liferay.ide.project.core 4 0 2015-05-11 14:45:13.804
!MESSAGE Error creating Liferay plugin project.
!STACK 1
org.eclipse.core.runtime.CoreException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431335706606' does not exist
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:182)
    at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:109)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOp$Impl.execute(Unknown Source)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard.performFinish(SapphireWizard.java:370)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard$3.run(SapphireWizard.java:334)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.io.FileNotFoundException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431335706606' does not exist
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1298)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1191)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1160)
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:176)
    ... 6 more
!SUBENTRY 1 com.liferay.ide.project.core 4 0 2015-05-11 14:45:13.804
!MESSAGE Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431335706606' does not exist
!STACK 0
java.io.FileNotFoundException: Source 'D:\Liferay_workspace\.metadata\.plugins\com.liferay.ide.sdk.core\create\1431335706606' does not exist
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1298)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1191)
    at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:1160)
    at com.liferay.ide.project.core.PluginsSDKProjectProvider.doCreateNewProject(PluginsSDKProjectProvider.java:176)
    at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:109)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOp$Impl.execute(Unknown Source)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard.performFinish(SapphireWizard.java:370)
    at org.eclipse.sapphire.ui.forms.swt.SapphireWizard$3.run(SapphireWizard.java:334)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Please assist. I am new to liferay.

Liferay Version: Liferay Portal Tomcat 6.2 CE GA4 SDK Version: liferay-plugins-sdk-6.2-ce-ga4

Android Built-In SMS Page Removal?

So, I'm building an application that would send an automatic SMS to another phone. Just like the "hello world!" SMS sample, it would send the same SMS as the button implies. However, when I press the button; it would pop-up the built-in SMS page that would allow the user to edit the text or Phone #.

Here's my code (MainActivity.java):

public class MainActivity extends Activity {

    private EditText messageNumber;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        messageNumber=(EditText)findViewById(R.id.messageNumber);
    }
                /*LOCK BUTTON*/
    public void Lock(View v) {

        String _messageNumber=messageNumber.getText().toString();
        String messageText = "F4";

        Intent sendIntent = new Intent(Intent.ACTION_VIEW);
        sendIntent.setData(Uri.parse("sms:"+_messageNumber));
        sendIntent.putExtra("sms_body", messageText);
        startActivity(sendIntent);
    }

Kontakt.io iBeacon gets scanned with too much interval on Android

I bought 3 kontakt.io iBeacon and I had no problem to create the code in order to scan them on IOS but for android I'm having some problems.. The error is that I can correctly scan the iBeacons once but after that they doesn't gets scanned anymore or they gets scanned after a long period of time, this is the code I've used so far:

public class BeaconMonitorActivity extends Activity {

    private static final int REQUEST_CODE_ENABLE_BLUETOOTH = 1;

    private BeaconManager beaconManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        beaconManager = BeaconManager.newInstance(this);
        beaconManager.setMonitorPeriod(MonitorPeriod.MINIMAL);
        beaconManager.setScanMode(1);
        beaconManager.setForceScanConfiguration(ForceScanConfiguration.DEFAULT);
        beaconManager.registerMonitoringListener(new BeaconManager.MonitoringListener() {
            @Override
            public void onMonitorStart() {

            }

            @Override
            public void onMonitorStop() {}

            @Override
            public void onBeaconsUpdated(final Region region, final List<BeaconDevice> beacons) {}

            @Override
            public void onBeaconAppeared(final Region region, final BeaconDevice beacon) {

                Handler handler = new Handler(Looper.getMainLooper());
                handler.post(
                    new Runnable()
                    {
                        @Override
                        public void run()
                        {
                            if(beacon.getProximity() == Proximity.IMMEDIATE)
                            {
                                if(beacon.getMinor() == 33506)
                                {
                                    AlertDialog.Builder builder = new AlertDialog.Builder(BeaconMonitorActivity.this);
                                    builder.setMessage("Trovato iBeacon 1")
                                       .setCancelable(false)
                                       .setPositiveButton("Dettagli", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                                BeaconMonitorActivity.this.finish();
                                           }
                                       })
                                       .setNegativeButton("Continua lo Scan", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                               try {
                                                beaconManager.startMonitoring();
                                            } catch (RemoteException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                               try {
                                                    beaconManager.startMonitoring();
                                                } catch (RemoteException e) {
                                                    // TODO Auto-generated catch block
                                                    e.printStackTrace();
                                                }
                                                dialog.cancel();
                                           }
                                       });
                                    AlertDialog alert = builder.create();
                                    alert.show();
                                }

                                if(beacon.getMinor() == 16706)
                                {
                                    AlertDialog.Builder builder = new AlertDialog.Builder(BeaconMonitorActivity.this);
                                    builder.setMessage("Trovato iBeacon 2")
                                       .setCancelable(false)
                                       .setPositiveButton("Dettagli", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                                BeaconMonitorActivity.this.finish();
                                           }
                                       })
                                       .setNegativeButton("Continua lo Scan", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                               try {
                                                beaconManager.startMonitoring();
                                            } catch (RemoteException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                               try {
                                                    beaconManager.startMonitoring();
                                                } catch (RemoteException e) {
                                                    // TODO Auto-generated catch block
                                                    e.printStackTrace();
                                                }
                                                dialog.cancel();
                                           }
                                       });
                                    AlertDialog alert = builder.create();
                                    alert.show();
                                }

                                if(beacon.getMinor() == 48997)
                                {
                                    AlertDialog.Builder builder = new AlertDialog.Builder(BeaconMonitorActivity.this);
                                    builder.setMessage("Trovato iBeacon 3")
                                       .setCancelable(false)
                                       .setPositiveButton("Dettagli", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                                BeaconMonitorActivity.this.finish();
                                           }
                                       })
                                       .setNegativeButton("Continua lo Scan", new DialogInterface.OnClickListener() {
                                           public void onClick(DialogInterface dialog, int id) {
                                               try {
                                                beaconManager.startMonitoring();
                                            } catch (RemoteException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                               try {
                                                beaconManager.startMonitoring();
                                            } catch (RemoteException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                                dialog.cancel();
                                           }
                                       });
                                    AlertDialog alert = builder.create();
                                    alert.show();
                                }
                            }
                        }
                    }
                );

            }

            @Override
            public void onRegionEntered(final Region region) {}

            @Override
            public void onRegionAbandoned(final Region region) {}


        });

    }

    @Override
    protected void onStart() {
        super.onStart();
        if(!beaconManager.isBluetoothEnabled()) {
            final Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(intent, REQUEST_CODE_ENABLE_BLUETOOTH);
        } else if(beaconManager.isConnected()) {
            try {
                beaconManager.startRanging();
            } catch (RemoteException e) {
                e.printStackTrace();
            }

        } else {
            connect();
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
        beaconManager.stopMonitoring();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        beaconManager.disconnect();
        beaconManager = null;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {

        if(requestCode == REQUEST_CODE_ENABLE_BLUETOOTH) {
            if(resultCode == Activity.RESULT_OK) {
                connect();
            } else {
                Toast.makeText(this, "Bluetooth not enabled", Toast.LENGTH_LONG).show();
                getActionBar().setSubtitle("Bluetooth not enabled");
            }
            return;
        }

        super.onActivityResult(requestCode, resultCode, data);
    }

    private void connect() {
        try {
            beaconManager.connect(new OnServiceBoundListener() {
                @Override
                public void onServiceBound() {
                    try {
                        beaconManager.startMonitoring();
                        //beaconManager.startMonitoring(Region.EVERYWHERE);
                    } catch (RemoteException e) {
                        e.printStackTrace();
                    }
                }
            });
        } catch (RemoteException e) {
            throw new IllegalStateException(e);
        }
    }
}

Am I scanning for the beacons in the wrong function? Please help

Eclispse Install software says "Can not complete the request"

I am using Eclipse Luna Service Release 1 (4.4.1) When I try to install new software It gives some error message like Cannot complete the request. This installation has not been configured properly for Software Updates. And my error log says

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_75
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IN
Framework arguments:  -product org.eclipse.epp.package.standard.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.standard.product

org.eclipse.equinox.p2.ui.sdk
Warning
Mon May 11 14:35:07 IST 2015
Could not locate the running profile instance. The eclipse.p2.data.area and eclipse.p2.profile properties may not be set correctly in this application's config.ini file.

I came across similar problems in How to enable Software Update in an Eclipse product? and Getting the message "Cannot start the update ui..." when trying to run the update UI in Eclipse but it didnot solve my problem

"Can not find source" in Eclipse CDT in UBUNTU 14.10

My problem is that I try to debug this simple Hello World Program in Eclipse LUNA CDT and UBUNTU 14.10 but get the error- can't find source at /build/buildd/glibc-2.19/stdio-common/printf.c. My Code is

# include <stdio.h>`
int main()`
{
   printf("\n Hello World!!");
   return 0;
}

I could really use some help here. Thanks in advance.

send udp message from android phone to PC(windows) not working

I want to send a UDP message from my android phone 4.2(client) to PC(server) using WIFI connection. My phone and PC are connected via wireless router. But no message is received from phone to mobile. I have successfully able to ping phone to PC. I have also tested this code for PC to PC connection successfully. I have added internet permission to manifest.xml. I would be greatefull, if you could help me. Thank you.

Client:

@Override
    protected void onCreate(Bundle savedInstanceState)
    {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);




        Button button1 = (Button) findViewById(R.id.button1);
        final TextView tv = (TextView) findViewById(R.id.textView1);
        final TextView tv2= (TextView) findViewById(R.id.textView2);







        button1.setOnClickListener(new OnClickListener()
        {

            @Override
            public void onClick(View v) 
            {

                boolean morgan= isOnline();
                String s = String.valueOf(morgan);
                tv.setText(s);


                try{

                    //InetAddress ipaddress = InetAddress.getByName("localhost");
                    InetAddress ipaddress = InetAddress.getByName("192.168.10.11");
                    int port = 6500;
                    //byte[] buffer = new byte[1024]; // empty byte array
                    String msg ="hello goooooooogle"; // send this message to the server
                    byte [] b_array = msg.getBytes();

                    //on SERVER side DatagramSocket able to receive packets on 8080 port
                    DatagramPacket packet = new DatagramPacket(b_array, b_array.length, ipaddress, port);// DatagramPacket(byte[], byte_length, InetAddress, port_number)
                    DatagramSocket socket = new DatagramSocket();
                    socket.send(packet);
                    socket.close();

                }
                catch(Exception e)
                {
                    System.out.println(e);
                }
                }




        });   
    }

    public boolean isOnline() {

        Runtime runtime = Runtime.getRuntime();
        try {

            Process ipProcess = runtime.exec("/system/bin/ping -c 1 192.168.10.11");
            //Process ipProcess = runtime.exec("/system/bin/ping -c 1 8.8.8.8");
            int     exitValue = ipProcess.waitFor();
            return (exitValue == 0);

        } 
        catch (IOException e)         
        { e.printStackTrace(); } 
          catch (InterruptedException e) { e.printStackTrace(); }

        return false;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings)
        {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

Server

public class server 
{
    public static void main(String args[])
    {

        try{
            System.out.println("aaa");
            byte[] inbuf = new byte[1000]; // default size
            DatagramPacket packet = new DatagramPacket(inbuf, inbuf.length);

            DatagramSocket socket = new DatagramSocket(6500);
            socket.receive(packet);

            int numBytesReceived = packet.getLength();
            System.out.println(numBytesReceived);
            String s = new String(inbuf);
            System.out.println(s);
            //System.out.println(inbuf[2]);

            socket.close();
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}

Triggering m2e's UpdateProject action

I am making my first steps in Eclipse plugin development. I wrote a small extension that triggers an action from the popup menu when a project in the project explorer is selected.

I am quite satisfied with the result because it automates an ennoying workflow which i had to perform repeatedly throughout the day.

Now, the icing on the cake would be if i could call the m2e plugin's UpdateProject action at the end of my implementation:

public class MyAction implements IObjectActionDelegate {

@Override
public void run(IAction action) {
    // .. doing something useful 
    PSEUDOCODE: M2eUtils.updateProject(action.getSelectedProject());
}

I did some research to figure out how to make it possible, but it seems to me i would have to dig deeper than i can afford at the moment to come to a solution on my own.

Any help is appreciated!

How to use Eclipse 3.x views in E4?

I am experienced with Eclipse 3.x development and now want to develop an E4 application. Therefor I tested a simple example in order to get started with the new things.

I was following this tutorial step by step but it results in the same error. However, he is not getting those errors.

I'm using Eclipse Luna (4.4.2) and installed the E4 Tools (0.17). I've created a new Eclipse 4 Application and added to the Application.e4xmi the Common Resource Navigator (Project Explorer) as Shared Part using Import 3x -> View as CompatibilityView. I then added a Placeholder which references the shared part. I have added all necessary plugins to the product's dependencies. I also have added the compatibility plugins.

However, when I start the application I get an InjectionException at InjectorImpl#internalMake()#331 which simply is:

if (unresolved(actualArgs) != -1) continue;

Debugging unresolved() let me to the following point (InjectorImpl#489):

Creatable creatableAnnotation = desiredClass.getAnnotation(Creatable.class);

Where the desiredClass is class org.eclipse.ui.internal.ViewReference. Then the function returns 1 which leads to continue in the upper case and the exception. The stacktrace is the following (full here):

!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-05-06 13:00:05.899
!MESSAGE Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityView' from bundle '96'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.ui.internal.e4.compatibility.CompatibilityView
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:346)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
...

How to setup a dynamic web application for multiple developers using github,eclipse,maven?

We are trying to build a web application and our sources are managed through github.

But, We are using maven,tomcat,eclipse,spring. But the problem is setting up the project for each one of us. When I create a server for tomcat in eclipse,I have to give an absolute path of my PC(ubuntu). But when other create server(on windows) they have to give their absolute path.

So my question is , should I have to upload the whole tomcat server , maven .m2 repository , etc to the github ? Or there is some other way to manage this ?

Android: App crashes since changing the id-tags of some views (using Eclipse)

Since some week's i am working on an app consisting of 3 activitys. 2 of them uses fragments. There are 31 layout-files (XML) in my project total. All was working fine ...... to yesterday.....

By creating the layouts for the fragment i used the auto-generated id's from eclipse (textView1, textView2 and so on). Yesterday I wanted some id's to rename. But something was going wrong. (i don't check the preview by dialog, so there was changed in other fragments and codeparts too. I try to remove the wrong changes,but it seems i forgot something, or just dont know about something)

All is fine when i toogle the fragment, but if i want to change something (e.g setText() on a TextView) the app crashes. It seems it couldnt find the View ("null object reference") but formally the app has found the View by id.

Here is the Error Log: ( i marked the critical part with a comment )

05-11 08:37:22.753: E/AndroidRuntime(6875): FATAL EXCEPTION: main
05-11 08:37:22.753: E/AndroidRuntime(6875): Process: com.nobody.allstuffapp, PID: 6875
05-11 08:37:22.753: E/AndroidRuntime(6875): java.lang.IllegalStateException: Could not execute method of the activity
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.view.View$1.onClick(View.java:4020)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.view.View.performClick(View.java:4780)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.view.View$PerformClick.run(View.java:19866)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.os.Handler.handleCallback(Handler.java:739)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.os.Handler.dispatchMessage(Handler.java:95)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.os.Looper.loop(Looper.java:135)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.app.ActivityThread.main(ActivityThread.java:5254)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at java.lang.reflect.Method.invoke(Native Method)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at java.lang.reflect.Method.invoke(Method.java:372)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
05-11 08:37:22.753: E/AndroidRuntime(6875): Caused by: java.lang.reflect.InvocationTargetException
05-11 08:37:22.753: E/AndroidRuntime(6875):     at java.lang.reflect.Method.invoke(Native Method)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at java.lang.reflect.Method.invoke(Method.java:372)
05-11 08:37:22.753: E/AndroidRuntime(6875):     at android.view.View$1.onClick(View.java:4015)
05-11 08:37:22.753: E/AndroidRuntime(6875):     ... 10 more
05-11 08:37:22.753: E/AndroidRuntime(6875): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
05-11 08:37:22.753: E/AndroidRuntime(6875):     at com.nobody.allstuffapp.LoginActivity.AGB1Show(LoginActivity.java:338)
05-11 08:37:22.753: E/AndroidRuntime(6875):     ... 13 more

And here is the source of the activity (blanked out some parts):

package com.nobody.allstuffapp;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ExecutionException;

import org.json.JSONArray;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;

import com.nobody.allstuffapp.db.AppStatus;
import com.nobody.allstuffapp.internet.RequestGetTask;

public class LoginActivity extends ActionBarActivity {

    public int shownfragment;
    private Context mContext;
    Bundle extras = new Bundle(); 
    private String ex_userName;
    private String ex_userEmail;
    private String ex_userPW;
    private boolean ex_userKeepLogged;

    private static String nameOfUserSetting = "LastUser.log";
    private static String nameOfAGBFile     = "Usertherms.txt";
    private static String nameOfDRightsFile = "Datarights.txt";
    private static String nameOfHelpFile    = "Help.txt";

    private File appFilesPath;
    private File UserLogFile = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        Toolbar toolbar = (Toolbar) findViewById(R.id.myToolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setIcon(R.drawable.ic_launcher);
        toolbar.setBackgroundColor(getResources().getColor(R.color.BaseColor));

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.login_contentframe, new LogonFragment()).commit();
            shownfragment = 0;
        }

        mContext = this;

        // get extra strings
        extras = getIntent().getExtras();
        ex_userName = extras.getString("userName");
        ex_userEmail = extras.getString("userEmail");
        ex_userPW = extras.getString("userPW");
        ex_userKeepLogged = Boolean.valueOf((extras.getString("userKeepLogged")));

        // get files-dir
        appFilesPath = mContext.getFilesDir();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        return super.onOptionsItemSelected(item);
    }

        // Fragment Logon Creator
        public  class LogonFragment extends Fragment {

            public LogonFragment() { }

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                View rootView = inflater.inflate(R.layout.fragment_login, container, false);
                return rootView;
            }
        }

        // Fragment Registrationsformular Creator
        public static class RegisterFragment extends Fragment {

            public RegisterFragment() { }

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                View rootView = inflater.inflate(R.layout.fragment_register, container, false);
                return rootView;
            }
        }

        // Fragment Nutzerbestimmungen Createtor
        public static class AGB1Fragment extends Fragment {

            public AGB1Fragment() { }

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                View rootView = inflater.inflate(R.layout.fragment_agb1, container, false);
                return rootView;
            }
        }

        // Fragment Datenverwendungsrichtlinien Createtor
        public static class AGB2Fragment extends Fragment {

            public AGB2Fragment() { }

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                View rootView = inflater.inflate(R.layout.fragment_agb2,container, false);
                return rootView;
            }
        }

        // Logon Screen einblenden
        public void HomeShow(View view){
            getSupportFragmentManager().beginTransaction()
            .replace(R.id.login_contentframe, new LogonFragment())
            .commit();
            this.setTitle(R.string.title_activity_login);
            shownfragment = 0;
        }

        // Registrationsformular einblenden
        public void RegisterMe(View view) {
            getSupportFragmentManager().beginTransaction()
            .replace(R.id.login_contentframe, new RegisterFragment())
            .commit();
            this.setTitle(R.string.str_register_title);
            shownfragment = 1;
        }

        private void hideKeyboard() {   
            // Check if no view has focus:
            View view = this.getCurrentFocus();
            if (view != null) {
                InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
                inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
            }
        }

        // Nutzerbestimmungen einblenden
        public void AGB1Show(View view) {
            AGB1Fragment agb1Fragment = new AGB1Fragment();
            getSupportFragmentManager().beginTransaction()
            .replace(R.id.login_contentframe, agb1Fragment)
            .commit();
            this.setTitle(R.string.str_login_usertherms);


// ================= this will cause a crash (log shown below) ====================
            ((TextView) findViewById(R.id.lay_agb1).findViewById(R.id.tv_agb1_agbcontent)).setText("Hello World!!!");

// ========= same happens without searching for layout id =====================
// = no problems till yesterday. Only the R.id.tv_agb1_agbcontent chanched =
            ((TextView) findViewById(R.id.tv_agb1_agbcontent)).setMovementMethod(LinkMovementMethod.getInstance());
            ((TextView) findViewById(R.id.tv_agb1_agbcontent)).setText(Html.fromHtml(getResources().getString(R.string.txt_agb1)));


        }

        // Datenverwendungsrichtlinien einblenden
        public void AGB2Show(View view) {
            getSupportFragmentManager().beginTransaction()
            .replace(R.id.login_contentframe, new AGB2Fragment())
            .commit();
            this.setTitle(R.string.str_login_datatherms);
            shownfragment = 1;  
        }


}

The Activity layout:

<FrameLayout xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:background="#ffffff"
    android:orientation="vertical"
    tools:context="com.nobody.allstuffapp.LoginActivity" >

    <include
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/mytoolbar" />

    <ScrollView
        android:id="@+id/login_contentframe"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/abc_action_bar_default_height_material"
        android:scrollbarStyle="outsideInset" >
    </ScrollView>

</FrameLayout>

And here is the fragment_agb1.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical"
     android:id="@+id/lay_agb1" >

        <TextView
            android:id="@+id/tv_agb1_agbcontent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:paddingLeft="0dp"
            android:text="@string/txt_agb1"
            android:textSize="14sp" />

        <RelativeLayout
            android:id="@+id/lay_agb1_button_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:layout_marginTop="20dp"
            android:gravity="center" >

            <ImageView
                android:id="@+id/iv_agb1_button_back"
                android:layout_width="wrap_content"
                android:layout_height="44dp"
                android:contentDescription="@string/str_cont_register"
                android:onClick="HomeShow"
                android:scaleType="centerInside"
                android:src="@drawable/bz_main_nobanner" />

            <TextView
                android:id="@+id/tv_agb1_buttoncaption_back"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="@string/str_login_back"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#000000" />

        </RelativeLayout>

        <TextView
            android:id="@+id/tv_agb1_copyright"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:text="@string/str_login_copyright"
            android:textSize="12sp" />

</LinearLayout>

Hope somebody of you can help me. I couldn't find the problem yet. Sorry for my bad english.

thx.

I am trying for implementing gmail login but it shows an error "unable to execute dex: java heap space eclipse"

Unable to implement Gmail Login in eclipse ubuntu 14.04 I have imported Google play sevice library also but when i am executing it shows error "Unable to execute dex: Java heap space" and "Conversion to Dalvik format failed: Unable to execute dex: Java heap space"

Thanks in advance

Error while submitting a job with Hadoop 2.6.0 on Windows

I'm working on a Java project running with Hadoop 0.20.1 and I'm trying to migrate to Hadoop 2.6.0. Once I've changed the corresponding Hadoop jar files in the project, I obtain the following error when submitting a job:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
    at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method)
    at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:557)
    at org.apache.hadoop.fs.FileUtil.canRead(FileUtil.java:977)
    at org.apache.hadoop.util.DiskChecker.checkAccessByFileMethods(DiskChecker.java:187)
    at org.apache.hadoop.util.DiskChecker.checkDirAccess(DiskChecker.java:174)
    at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:108)
    at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:285)
    at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:344)
    at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:150)
    at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:131)
    at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:115)
    at org.apache.hadoop.mapred.LocalDistributedCacheManager.setup(LocalDistributedCacheManager.java:131)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.<init>(LocalJobRunner.java:163)
    at org.apache.hadoop.mapred.LocalJobRunner.submitJob(LocalJobRunner.java:731)
    at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:536)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1296)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1293)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:1293)

I've read it could be a problem related to Hadoop binaries, but I've built them myself, placed them in "c:\hadoop\bin" and the environment variable HADOOP_HOME has the right value.

I'm running my project on Eclipse, on a machine with Windows 7 64 bits and Java 8.

Can anyone help me with this?

Thanks!