问:
Java generics - ArrayList initialization
It is known that arraylist init. should be like this

```<code>ArrayList<A> a = new ArrayList<A>();
ArrayList<Integer> a = new ArrayList<Number>(); // compile-time error
</code>```

so, why does java allow these ?

```<code>1. ArrayList<? extends Object> a1 = new ArrayList<Object>();
2. ArrayList<?> a2 = new ArrayList<Integer>();
</code>```

then, if they are correct why doesn't allow these ?

```<code>1. a1.add(3);
2. a2.add(3);
</code>```

the compiler message is : The method add(int, capture#1-of ? extends Object) in the type ArrayList is not applicable for the arguments (int)

more general

```<code>  1. a1.add(null e);
  2. a2.add(? e);
</code>```

I read about this but it is good to hear from you. thanks

the other amusing point is :

```<code> ArrayList<ArrayList<?>> a = new ArrayList<ArrayList<?>>(); // correct
 ArrayList<?> a = new ArrayList<?>(); // wrong. I know it's reason but I have some
question in my mind that mentioned above
</code>```

答:
A lot of this has to do with polymorphism.  When you assign

```<code>X = new Y();
</code>```

X can be much less 'specific' than Y, but not the other way around.  X is just the handle you are accessing Y with, Y is the real instantiated thing,

You get an error here because Integer is a Number, but Number is not an Integer.

```<code>ArrayList<Integer> a = new ArrayList<Number>(); // compile-time error
</code>```

As such, any method of X that you call must be valid for Y.  Since X is more generally it probably shares some, but not all of Y's methods.  Still, any arguments given must be valid for Y.

In your examples with add, an int (small i) is not a valid Object or Integer.

```<code>ArrayList<?> a = new ArrayList<?>();
</code>```

This is no good because you can't actually instantiate an array list containing ?'s.   You can declare one as such, and then damn near anything can follow in new ArrayList<Whatever>();

Body:
It is known that arraylist init. should be like this

ArrayList a = new ArrayList();
ArrayList<Integer> a = new ArrayList<Number>(); // compile-time error

so, why does java allow these ?

1. ArrayList<? extends Object> a1 = new ArrayList<Object>();
2. ArrayList<?> a2 = new ArrayList<Integer>();

then, if they are correct why doesn't allow these ?

1. a1.add(3);
2. a2.add(3);

the compiler message is : The method add(int, capture#1-of ? extends Object) in the type ArrayList is not applicable for the arguments (int)

more general

  1. a1.add(null e);
  2. a2.add(? e);

I read about this but it is good to hear from you. thanks

the other amusing point is :

 ArrayList<ArrayList<?>> a = new ArrayList<ArrayList<?>>(); // correct
 ArrayList<?> a = new ArrayList<?>(); // wrong. I know it's reason but I have some
question in my mind that mentioned above

Body:
A lot of this has to do with polymorphism.  When you assign

X = new Y();

X can be much less 'specific' than Y, but not the other way around.  X is just the handle you are accessing Y with, Y is the real instantiated thing,

You get an error here because Integer is a Number, but Number is not an Integer.

ArrayList<Integer> a = new ArrayList<Number>(); // compile-time error

As such, any method of X that you call must be valid for Y.  Since X is more generally it probably shares some, but not all of Y's methods.  Still, any arguments given must be valid for Y.

In your examples with add, an int (small i) is not a valid Object or Integer.

ArrayList<?> a = new ArrayList<?>();

This is no good because you can't actually instantiate an array list containing ?'s.   You can declare one as such, and then damn near anything can follow in new ArrayList<Whatever>();


来源: stackexchange

问:
Remove URL parameters after redisplaying page
I have a page which lets me create and save a record.  When I click Save, I want to stay on the same page, but have that page display an updated view model.  The problem I'm having is that after I save, the GET parameters stay in the page URL.

When I run my application, I go to the "list records" page and click the "create new" button.  That causes a GET request to EditRecord with the createNew parameter set to true.  The request looks like localhost/Home/EditRecord?createNew=True

```<code>public ActionResult EditRecord(string id, bool createNew = false)
{
    MyRecordViewModel viewModel;
    if (createNew)
    {
        viewModel = new MyRecordViewModel
        {
            IsNew = true
        };
    }
    else
    {
        var myRecord = (from p in this.context.MyRecords
                        where p.Id = id
                        select p).FirstOrDefault();
        if (myRecord == null)
        {
            this.ErrorMessage("Cannot find record.");
            return View();
        }
        viewModel = new MyRecordViewModel(myRecord);
    }

    return View(viewModel);
}
</code>```

Then when I click save, it POSTs to this method

```<code>[HttpPost]
public ActionResult EditRecord(MyRecordViewModel viewModel)
{
    // Save record to database
    // ...

    // Update the view model
    viewModel.LastUpdatedDttm = DateTime.Now;

    // Clear the model state dictionary so that my updated view model's values will be shown on the page
    ModelState.Clear();

    // Go back to the same page with an updated view model
    return View(viewModel);
}
</code>```

The updated page is displayed correctly with the updated view model.  The problem is that the URL is still localhost/Home/EditRecord?createNew=True.  I want the URL to be localhost/Home/EditRecord

I don't want to redirect back to the GET page with my record ID and with createNew equal to false, because that'll cause an unnecessary trip to the database in order to redisplay the same record.

答: You need to use the PRG (Post-Redirect-Get) pattern. Simply, after you successfully do your edit or whatever, do not return the view again, but instead return a redirect. If you want the same page loaded again, just redirect to the same page. The key is that by doing the redirect, you're reloading everything fresh without carry over in things like the URL. This also then negates the need to do antipatterns like ModelState.Clear().

ContentLicense: CC BY-SA 3.0

Body:
I have a page which lets me create and save a record.  When I click Save, I want to stay on the same page, but have that page display an updated view model.  The problem I'm having is that after I save, the GET parameters stay in the page URL.

When I run my application, I go to the "list records" page and click the "create new" button.  That causes a GET request to EditRecord with the createNew parameter set to true.  The request looks like localhost/Home/EditRecord?createNew=True

public ActionResult EditRecord(string id, bool createNew = false)
{
    MyRecordViewModel viewModel;
    if (createNew)
    {
        viewModel = new MyRecordViewModel
        {
            IsNew = true
        };
    }
    else
    {
        var myRecord = (from p in this.context.MyRecords
                        where p.Id = id
                        select p).FirstOrDefault();
        if (myRecord == null)
        {
            this.ErrorMessage("Cannot find record.");
            return View();
        }
        viewModel = new MyRecordViewModel(myRecord);
    }

    return View(viewModel);
}

Then when I click save, it POSTs to this method

[HttpPost]
public ActionResult EditRecord(MyRecordViewModel viewModel)
{
    // Save record to database
    // ...

    // Update the view model
    viewModel.LastUpdatedDttm = DateTime.Now;

    // Clear the model state dictionary so that my updated view model's values will be shown on the page
    ModelState.Clear();

    // Go back to the same page with an updated view model
    return View(viewModel);
}

The updated page is displayed correctly with the updated view model.  The problem is that the URL is still localhost/Home/EditRecord?createNew=True.  I want the URL to be localhost/Home/EditRecord

I don't want to redirect back to the GET page with my record ID and with createNew equal to false, because that'll cause an unnecessary trip to the database in order to redisplay the same record.


问:
Get selected Option from Bootstrap Dropdown
I want to get the currently selected option. I have this html bootstrap code:

```<code>    <div class="form-group">
        <label class="col-md-4 control-label" for="callType">Call</label>
        <div class="col-md-6">
            <select id="callType" name="callType" class="form-control">
                <option value="getBpmn">getBpmn</option>
                <option value="getTime">getTime</option>

            </select>
        </div>
    </div>
</code>```

and the following js:

```<code>$(document).ready(function () {
    $('#callType').change(dropped)
});

function dropped(){

    console.log($(this).parent())
}
</code>```

But I have no Idea how to get the selected option.

答:
$("select").val() gives you value of selected option. in your code $(this).val() gives you value of select box

$(document).ready(function () {
    $('#callType').change(dropped)
});

function dropped(){

    console.log($(this).val())
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group">
        <label class="col-md-4 control-label" for="callType">Call</label>
        <div class="col-md-6">
            <select id="callType" name="callType" class="form-control">
                <option value="getBpmn">getBpmn</option>
                <option value="getTime">getTime</option>

            </select>
        </div>
    </div></code>```

Body:
I want to get the currently selected option. I have this html bootstrap code:

        Call

            <select id="callType" name="callType" class="form-control">
                <option value="getBpmn">getBpmn</option>
                <option value="getTime">getTime</option>

            </select>

and the following js:

$(document).ready(function () {
    $('#callType').change(dropped)
});

function dropped(){

    console.log($(this).parent())
}

But I have no Idea how to get the selected option.

Body:
$("select").val() gives you value of selected option. in your code $(this).val() gives you value of select box

$(document).ready(function () {
    $('#callType').change(dropped)
});

function dropped(){

    console.log($(this).val())
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group">
        <label class="col-md-4 control-label" for="callType">Call</label>
        <div class="col-md-6">
            <select id="callType" name="callType" class="form-control">
                <option value="getBpmn">getBpmn</option>
                <option value="getTime">getTime</option>

            </select>
        </div>
    </div>


问:
System.InvalidOperationException when modifiying value in an xml file in C#
So i... Have this snippet of code what writes to an existing xml file... the code to me is VERY simple...

```<code>            XElement element;
            XDocument xdoc = XDocument.Load(FileLoc);
            element = xdoc.Elements(XName.Get("gold", "http://schemas.datacontract.org/2004/07/DumaLegend")).Single();
            element.Value = Gold.Text;
</code>```

Good Right? good! but why does it give out that error which means that it can't find the thing? it's a very valid thing....

here is the xml file:

<?xml version="1.0" encoding="utf-8"?>
<Save xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DumaLegend">
  <saveInfo>
    <energyPieces>0</energyPieces>
    <fullEnergyCells>4</fullEnergyCells>
    <fullHearts>4</fullHearts>
    <globalSwitches xmlns:d3p1="a">
      <d3p1:switchList xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
    </globalSwitches>
    <gold>0</gold>
    <hasBigFireball>false</hasBigFireball>
    <hasCombo>false</hasCombo>
    <hasCrossbow>false</hasCrossbow>
    <hasDash>false</hasDash>
    <hasDashUpgrade>false</hasDashUpgrade>
    <hasDoubleJump>false</hasDoubleJump>
    <hasFireball>false</hasFireball>
    <hasHookshot>false</hasHookshot>
    <hasInvisPot>false</hasInvisPot>
    <hasSecondCombo>false</hasSecondCombo>
    <hasShieldUpgrade>false</hasShieldUpgrade>
    <hasSmallFireball>false</hasSmallFireball>
    <heartPieces>0</heartPieces>
    <heroPosOnMap>0</heroPosOnMap>
    <heroTokens>0</heroTokens>
    <itemSlot1 xmlns:d3p1="http://schemas.datacontract.org/2004/07/DumaLegend.Objects.Consumables" i:nil="true" />
    <itemSlot2 xmlns:d3p1="http://schemas.datacontract.org/2004/07/DumaLegend.Objects.Consumables" i:nil="true" />
    <lives>3</lives>
    <worldsUnlocked>0</worldsUnlocked>
    <worldsUnlockedOnMap>0</worldsUnlockedOnMap>
  </saveInfo>
  <saveSlot>0</saveSlot>
</Save>```

Body:
So i... Have this snippet of code what writes to an existing xml file... the code to me is VERY simple...

            XElement element;
            XDocument xdoc = XDocument.Load(FileLoc);
            element = xdoc.Elements(XName.Get("gold", "http://schemas.datacontract.org/2004/07/DumaLegend")).Single();
            element.Value = Gold.Text;

Good Right? good! but why does it give out that error which means that it can't find the thing? it's a very valid thing....

here is the xml file:

<?xml version="1.0" encoding="utf-8"?>
<Save xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DumaLegend">
  <saveInfo>
    <energyPieces>0</energyPieces>
    <fullEnergyCells>4</fullEnergyCells>
    <fullHearts>4</fullHearts>
    <globalSwitches xmlns:d3p1="a">
      <d3p1:switchList xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
    </globalSwitches>
    <gold>0</gold>
    <hasBigFireball>false</hasBigFireball>
    <hasCombo>false</hasCombo>
    <hasCrossbow>false</hasCrossbow>
    <hasDash>false</hasDash>
    <hasDashUpgrade>false</hasDashUpgrade>
    <hasDoubleJump>false</hasDoubleJump>
    <hasFireball>false</hasFireball>
    <hasHookshot>false</hasHookshot>
    <hasInvisPot>false</hasInvisPot>
    <hasSecondCombo>false</hasSecondCombo>
    <hasShieldUpgrade>false</hasShieldUpgrade>
    <hasSmallFireball>false</hasSmallFireball>
    <heartPieces>0</heartPieces>
    <heroPosOnMap>0</heroPosOnMap>
    <heroTokens>0</heroTokens>
    <itemSlot1 xmlns:d3p1="http://schemas.datacontract.org/2004/07/DumaLegend.Objects.Consumables" i:nil="true" />
    <itemSlot2 xmlns:d3p1="http://schemas.datacontract.org/2004/07/DumaLegend.Objects.Consumables" i:nil="true" />
    <lives>3</lives>
    <worldsUnlocked>0</worldsUnlocked>
    <worldsUnlockedOnMap>0</worldsUnlockedOnMap>
  </saveInfo>
  <saveSlot>0</saveSlot>
</Save>

Body: Use xdoc.Descendants(XName.Get("gold", "http://schemas.datacontract.org/2004/07/DumaLegend")).


问:
error: control reaches end of non-void function:(
I know this has been asked before but still I couldn't find a fix. The program is supposed to sum all even digits in a number using recursion. Here's the code that produces the error control reaches end of non-void function:

```<code>#include<stdio.h>

int sum_even_d(unsigned long n);

int main()
{
    unsigned long n;
    int x;
    printf("Enter n : \n");
    scanf("%lu",&n);
    x=sum_even_d(n);
    printf("%d\n",x);
    return 0;

}

int sum_even_d(unsigned long n)
{
    if(n==0) return 0;
    if(n%2==0)
        return (sum_even_d(n/10)+n%10);//*error here*//
}
</code>```

If I add one line though, the program works perfectly. I don't understand what made the difference:

```<code>#include<stdio.h>

int sum_even_d(unsigned long n);

int main()
{
    unsigned long n;
    int x;
    printf("Enter n : \n");
    scanf("%lu",&n);
    x=sum_even_d(n);
    printf("%d\n",x);
    return 0;

    }

int sum_even_d(unsigned long n)
{
    if(n==0) return 0;
    if(n%2==0)
        return (sum_even_d(n/10)+n%10);
    else return (sum_even_d(n/10));//*added this*//
}
</code>```

答:
All possible paths of a function that do not have a return type of void must return a value.

In your first piece of code, if the condition if(n%2==0) is false, the code runs to the end of the function but hasn't returned a value.  Back in the calling function, the return value is unknown because you didn't specify one.  This invoked undefined behavior.

Your second code does return a value for all paths, so no error.

Body:
I know this has been asked before but still I couldn't find a fix. The program is supposed to sum all even digits in a number using recursion. Here's the code that produces the error control reaches end of non-void function:

#include<stdio.h>

int sum_even_d(unsigned long n);

int main()
{
    unsigned long n;
    int x;
    printf("Enter n : \n");
    scanf("%lu",&n);
    x=sum_even_d(n);
    printf("%d\n",x);
    return 0;

}

int sum_even_d(unsigned long n)
{
    if(n==0) return 0;
    if(n%2==0)
        return (sum_even_d(n/10)+n%10);//*error here*//
}

If I add one line though, the program works perfectly. I don't understand what made the difference:

#include<stdio.h>

int sum_even_d(unsigned long n);

int main()
{
    unsigned long n;
    int x;
    printf("Enter n : \n");
    scanf("%lu",&n);
    x=sum_even_d(n);
    printf("%d\n",x);
    return 0;

    }

int sum_even_d(unsigned long n)
{
    if(n==0) return 0;
    if(n%2==0)
        return (sum_even_d(n/10)+n%10);
    else return (sum_even_d(n/10));//*added this*//
}


问:
Unsigned long back into pointer to a class
Now, I am doing a exercise in introduction to algorithms by using C++.
The question is :

Explain how to implement doubly linked lists using only one pointer
  value x.np per item instead of the usual two (next and prev). Assume
  that all pointer values can be interpreted as k-bit integers, and
  define x.np = x.next XOR x.prev, the k-bit "exclusive-or" of x.next
  and x.prev. (The value NIL is represented by 0). Be sure to describe
  what information you need to access the head of the list. Show how to
  implement the SEARCH, INSERT and DELETE operations on such a list.
  Also show how to reverse such a list in O(1) time.

In the XOR function, I first convert pointer to class into unsigned long and Xor these two value. And then convert the result back to a pointer to class. I don't know why it doesn't work. Here is my code:

```<code>struct node
{
int key;

node *np;
} ;

struct list_n
{
node *head;

node *tail;
};
</code>```

The above are two structs and below is insertion

```<code>void insert_element(list_n *_list, int _key)
{
    node *present_node= new node;

    present_node->key=_key;

    present_node->np=xor_gate(nullptr,_list->tail);

    if(_list->tail) _list-> tail->np=xor_gate(present_node,xor_gate(nullptr,_list->tail->np ));

    if(!_list->head) _list->head=present_node;

    _list->tail=present_node;
}
</code>```

Below is the Xor gate :

```<code>node *xor_gate(node *left,node *right)
{
    unsigned long result;

    result =  ( reinterpret_cast<unsigned long>(left) ) ^  ( reinterpret_cast<unsigned long>(right) );

    node *output =new node;

    output = reinterpret_cast<node*> (result);  // yes or no

    return output ;
}

void list_n_inti(list_n *a )
{
    a->head =nullptr;

    a->tail =nullptr;
}
</code>```

I have review the code several times. I think the problem is caused by XOR gate.

If you have found the bug please tell me. And if you have any other ways to answer this question. please tell me.

Thank you

答:
There is a memory leak in xor_gate, but I think the code works if you compile it as 32-bits. If you compile it as 64-bits, then unsigned long cannot contain a pointer generally.

try this:

```<code>#include <cstdint>  // for uintptr_t

node *xor_gate(node *left,node *right)
{
    using std::uintptr_t;

    uintptr_t result =  ( reinterpret_cast<uintptr_t>(left) ) ^  ( reinterpret_cast<uintptr_t>(right) );

    return reinterpret_cast<node*> (result);
}
</code>```

Body:
Now, I am doing a exercise in introduction to algorithms by using C++.
The question is :

Explain how to implement doubly linked lists using only one pointer
  value x.np per item instead of the usual two (next and prev). Assume
  that all pointer values can be interpreted as k-bit integers, and
  define x.np = x.next XOR x.prev, the k-bit "exclusive-or" of x.next
  and x.prev. (The value NIL is represented by 0). Be sure to describe
  what information you need to access the head of the list. Show how to
  implement the SEARCH, INSERT and DELETE operations on such a list.
  Also show how to reverse such a list in O(1) time.

In the XOR function, I first convert pointer to class into unsigned long and Xor these two value. And then convert the result back to a pointer to class. I don't know why it doesn't work. Here is my code:

struct node
{
int key;

node *np;
} ;

struct list_n
{
node *head;

node *tail;
};

The above are two structs and below is insertion

void insert_element(list_n *_list, int _key)
{
    node *present_node= new node;

    present_node->key=_key;

    present_node->np=xor_gate(nullptr,_list->tail);

    if(_list->tail) _list-> tail->np=xor_gate(present_node,xor_gate(nullptr,_list->tail->np ));

    if(!_list->head) _list->head=present_node;

    _list->tail=present_node;
}

Below is the Xor gate :

node *xor_gate(node *left,node *right)
{
    unsigned long result;

    result =  ( reinterpret_cast<unsigned long>(left) ) ^  ( reinterpret_cast<unsigned long>(right) );

    node *output =new node;

    output = reinterpret_cast<node*> (result);  // yes or no

    return output ;
}

void list_n_inti(list_n *a )
{
    a->head =nullptr;

    a->tail =nullptr;
}

I have review the code several times. I think the problem is caused by XOR gate.

If you have found the bug please tell me. And if you have any other ways to answer this question. please tell me.

Thank you

Body:
There is a memory leak in xor_gate, but I think the code works if you compile it as 32-bits. If you compile it as 64-bits, then unsigned long cannot contain a pointer generally.

try this:

#include <cstdint>  // for uintptr_t

node *xor_gate(node *left,node *right)
{
    using std::uintptr_t;

    uintptr_t result =  ( reinterpret_cast<uintptr_t>(left) ) ^  ( reinterpret_cast<uintptr_t>(right) );

    return reinterpret_cast<node*> (result);
}


问:
How to enable Android tethering via shell command(s)?
Is there a way to enable the USB Tethering option in Android 2.2 FRG22D using a shell command?

My goal is turn a Motorola Droid running Android 2.2 into a micro server. This device cannot connect to 3G and Wifi is not option. The device will always be connected via USB to a computer with a network connection. I have gotten the reverse tethering working, but I still have to manually check the USB Tethering check box (Settings->Wireless & Networks -> Tethering -> USB Tethering) every time the USB connection resets (such as when the computer is rebooted, the cable is unplugged, etc). My goal is write a script that can be ran on the host computer to bring the USB Tethering up without having to touch the Droid (I have root access and the device will always be connected via USB so I can issue shell commands using ADB).

I have been searching for a shell command to do this but nothing has turned up. Another possible solution is that I could write a small app (either using the NDK or SDK) and call that from the script, but again I cannot find any information on how to change system settings (at least network level settings) via code.

Any suggestions?

答: in the source code of Settings app, mWifiManager.setWifiApEnabled(null, enable) is used, but this functionality seems to be missing in the SDK (checked 2.2 and 2.3).</p>

ContentLicense: CC BY-SA 2.5


问:
$Env:ComputerName doesnt work with powershell Send-MailMessage in batch file
After a lot of errors and edits I got the Send-MailMessage to work through a command prompt.  Below iteration sends out the emails perfect.

```<code>powershell Send-MailMessage -From " `<user@domain>`" -To " `<user@domain.com>`" -Subject 'Some subject goes here' -Body 'Some body with alert regarding Host: $env:computername. List of deleted files is attached.' -Attachments 'C:\somefile.txt' -Priority High -dno onSuccess, onFailure -SmtpServer 'smtp.domain.com'
</code>```

However, this does not fetch the computername in the body. I have tried running this command in powershell directly and it works with the computername variable in body.

To get it to simply send out mails, I have already tried doing
  powershell -command "command" or powershell -command "{command} or
  powershell -command "& {command}" and so on and it doesnt even send
  out emails.

As I am now successful sending out emails, I need to have the Computername inside the body text.

答:
Your command line in the question and your own answer relies on the fact that powershell currently has the default (position 0) argument -Command,

but as this changes from PowerShell 6.0.0beta3 on to -File

you should explicitly use at least -C as the shortest
abbreviviation for -Command.

to speed up execution I'd use the additionl parameters -NoProfile or short -NoP and -NonInteractive or -NonI

to stop cmd from trying to interpret any parameters/arguments you should double quote them all - and escape any necessary inner double quotes with a backslash \" while also replacing double quotes with single ones if ever  possible.

So I'd suggest:

```<code>powershell -NoP -NonI -C "Send-MailMessage -From \"SomeWeb-Prod@domain.com\" -To \"fromuser@domain.com\" -Subject 'Some notification for SomeWeb-Prod' -Body 'Some Alert for Host: %computername% with IP: %NetworkIP% at %time%. details in attached file.' -Attachments 'C:\somefile.txt' -Priority High -dno onFailure -SmtpServer 'smtp.domain.com'"
</code>```

Or, (as you partly  discovered  yourself):

```<code>powershell -NoP -NonI -C "Send-MailMessage -From 'SomeWeb-Prod@domain.com' -To 'fromuser@domain.com' -Subject 'Some notification for SomeWeb-Prod' -Body 'Some Alert for Host: %computername% with IP: %NetworkIP% at %time%. details in attached file.' -Attachments 'C:\somefile.txt' -Priority High -dno onFailure -SmtpServer 'smtp.domain.com'"
</code>```

Body:
After a lot of errors and edits I got the Send-MailMessage to work through a command prompt.  Below iteration sends out the emails perfect.

powershell Send-MailMessage -From " `<user@domain>`" -To " `<user@domain.com>`" -Subject 'Some subject goes here' -Body 'Some body with alert regarding Host: $env:computername. List of deleted files is attached.' -Attachments 'C:\somefile.txt' -Priority High -dno onSuccess, onFailure -SmtpServer 'smtp.domain.com'

However, this does not fetch the computername in the body. I have tried running this command in powershell directly and it works with the computername variable in body.

To get it to simply send out mails, I have already tried doing
  powershell -command "command" or powershell -command "{command} or
  powershell -command "& {command}" and so on and it doesnt even send
  out emails.

As I am now successful sending out emails, I need to have the Computername inside the body text.

Body:
Your command line in the question and your own answer relies on the fact that powershell currently has the default (position 0) argument -Command,

but as this changes from PowerShell 6.0.0beta3 on to -File

you should explicitly use at least -C as the shortest
abbreviviation for -Command.

to speed up execution I'd use the additionl parameters -NoProfile or short -NoP and -NonInteractive or -NonI

to stop cmd from trying to interpret any parameters/arguments you should double quote them all - and escape any necessary inner double quotes with a backslash \" while also replacing double quotes with single ones if ever  possible.

So I'd suggest:

powershell -NoP -NonI -C "Send-MailMessage -From \"SomeWeb-Prod@domain.com\" -To \"fromuser@domain.com\" -Subject 'Some notification for SomeWeb-Prod' -Body 'Some Alert for Host: %computername% with IP: %NetworkIP% at %time%. details in attached file.' -Attachments 'C:\somefile.txt' -Priority High -dno onFailure -SmtpServer 'smtp.domain.com'"

Or, (as you partly  discovered  yourself):

powershell -NoP -NonI -C "Send-MailMessage -From 'SomeWeb-Prod@domain.com' -To 'fromuser@domain.com' -Subject 'Some notification for SomeWeb-Prod' -Body 'Some Alert for Host: %computername% with IP: %NetworkIP% at %time%. details in attached file.' -Attachments 'C:\somefile.txt' -Priority High -dno onFailure -SmtpServer 'smtp.domain.com'"


问:
find a specific element in nested XML File Spark scala
I want to select a spaecific element :
select("File.columns.column._name")

```<code> |-- File: array (nullable = true)
 |    |-- element: struct (containsNull = true)
 |    |    |-- _Description: string (nullable = true)
 |    |    |-- _RowTag: string (nullable = true)
 |    |    |-- _name: string (nullable = true)
 |    |    |-- _type: string (nullable = true)
 |    |    |-- columns: struct (nullable = true)
 |    |    |    |-- column: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- _Hive_Final_Table: string (nullable = true)
 |    |    |    |    |    |-- _Hive_Final_column: string (nullable = true)
 |    |    |    |    |    |-- _Hive_Table1: string (nullable = true)
 |    |    |    |    |    |-- _Hive_column1: string (nullable = true)
 |    |    |    |    |    |-- _Path: string (nullable = true)
 |    |    |    |    |    |-- _Type: string (nullable = true)
 |    |    |    |    |    |-- _VALUE: string (nullable = true)
 |    |    |    |    |    |-- _name: string (nullable = true)
</code>```

I got this error :

Exception in thread "main" org.apache.spark.sql.AnalysisException:
  cannot resolve 'File.columns.column[_name]' due to data type mismatch:
  argument 2 requires integral type, however, '_name' is of string
  type.;
          at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
          at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:65)
          at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:57)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:335)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:335)
          at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:69)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:334)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$5.apply(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$5.apply(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$4.apply(TreeNode.scala:281)
          at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
          at scala.collection.Iterator$class.foreach(Iterator.scala:727)
          at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
          at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
          at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:103)
          at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:47)
          at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:273)
          at scala.collection.AbstractIterator.to(Iterator.scala:1157)
          at scala.collection.TraversableOnce$class.toBuffer(TraversableOnce.scala:265)
          at scala.collection.AbstractIterator.toBuffer(Iterator.scala:1157)
          at scala.collection.TraversableOnce$class.toArray(TraversableOnce.scala:252)
          at scala.collection.AbstractIterator.toArray(Iterator.scala:1157)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformChildren(TreeNode.scala:321)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.plans.QueryPlan.transformExpressionUp$1(QueryPlan.scala:108)
          at org.apache.spark.sql.catalyst.plans.QueryPlan.org$apache$spark$sql$catalyst$plans$QueryPlan$$recursiveTransform$2(QueryPlan.scala:118)

Can you help me please ?

答:
You need explode function to get the required column

explode(Column e)
Creates a new row for each element in the given array or map column.

```<code>val df1 = df.select(explode($"File").as("File")).select($"File.columns").as("column")
</code>```

First, explode gives you column field

```<code>val finalDF = df1.select(explode($"(column"))."column")).select($"column._name").as("_name")
</code>```

Second explode gives you the _name column

Hope this helps!

Body:
I want to select a spaecific element :
select("File.columns.column._name")

 |-- File: array (nullable = true)
 |    |-- element: struct (containsNull = true)
 |    |    |-- _Description: string (nullable = true)
 |    |    |-- _RowTag: string (nullable = true)
 |    |    |-- _name: string (nullable = true)
 |    |    |-- _type: string (nullable = true)
 |    |    |-- columns: struct (nullable = true)
 |    |    |    |-- column: array (nullable = true)
 |    |    |    |    |-- element: struct (containsNull = true)
 |    |    |    |    |    |-- _Hive_Final_Table: string (nullable = true)
 |    |    |    |    |    |-- _Hive_Final_column: string (nullable = true)
 |    |    |    |    |    |-- _Hive_Table1: string (nullable = true)
 |    |    |    |    |    |-- _Hive_column1: string (nullable = true)
 |    |    |    |    |    |-- _Path: string (nullable = true)
 |    |    |    |    |    |-- _Type: string (nullable = true)
 |    |    |    |    |    |-- _VALUE: string (nullable = true)
 |    |    |    |    |    |-- _name: string (nullable = true)

I got this error :

Exception in thread "main" org.apache.spark.sql.AnalysisException:
  cannot resolve 'File.columns.column[_name]' due to data type mismatch:
  argument 2 requires integral type, however, '_name' is of string
  type.;
          at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
          at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:65)
          at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:57)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:335)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:335)
          at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:69)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:334)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$5.apply(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$5.apply(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$4.apply(TreeNode.scala:281)
          at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
          at scala.collection.Iterator$class.foreach(Iterator.scala:727)
          at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
          at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
          at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:103)
          at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:47)
          at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:273)
          at scala.collection.AbstractIterator.to(Iterator.scala:1157)
          at scala.collection.TraversableOnce$class.toBuffer(TraversableOnce.scala:265)
          at scala.collection.AbstractIterator.toBuffer(Iterator.scala:1157)
          at scala.collection.TraversableOnce$class.toArray(TraversableOnce.scala:252)
          at scala.collection.AbstractIterator.toArray(Iterator.scala:1157)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformChildren(TreeNode.scala:321)
          at org.apache.spark.sql.catalyst.trees.TreeNode.transformUp(TreeNode.scala:332)
          at org.apache.spark.sql.catalyst.plans.QueryPlan.transformExpressionUp$1(QueryPlan.scala:108)
          at org.apache.spark.sql.catalyst.plans.QueryPlan.org$apache$spark$sql$catalyst$plans$QueryPlan$$recursiveTransform$2(QueryPlan.scala:118)

Can you help me please ?

Body:
You need explode function to get the required column

explode(Column e)
Creates a new row for each element in the given array or map column.

val df1 = df.select(explode($"File").as("File")).select($"File.columns").as("column")

First, explode gives you column field

val finalDF = df1.select(explode($"(column"))."column")).select($"column._name").as("_name")

Second explode gives you the _name column

Hope this helps!


问:
Connect my Java application to SQL Server 2012
I have a SQL Server 2012 database in the network of my company.
I can access to this database to observe the tables etc... with SQL Server Management Studio giving the following :

Server type : Database Engine

Server name  : xxx-yyy-zzz.eu.company.corp, number_of_port

Authentication : Windows Authentication

Username and password

I also know the name of the database and nothing more.

I would like to connect a new Java program I am writing with Eclipse to this SQL Server database. But I have never connected or even used a SQL Server before so I have no idea how to do it. I understood reading some other posts that I need a driver, but I don't understand where I need to install this driver, which driver and what I need to do to extract data from the database in my Java program.

Could you please tell me more about it ? Thank you :)

答:
Some time back I had problems with Microsoft JDBC Driver and used open source JTDS. I do not remember exact problems, but JTDS worked just fine for me.

So, code to connect to database may look like:

```<code>        //Not required anymore - just for demonstration. Driver class must be in class path
        Class.forName("net.sourceforge.jtds.jdbc.Driver");

        Connection dbCon = DriverManager
                .getConnection("jdbc:jtds:sqlserver://{db_host}:[db_port]/{Database Name};domain={user Windows domain};user={user id};password={user password}");
        PreparedStatement stmt = dbCon.prepareStatement("SELECT GETDATE()");
        ResultSet resSet = stmt.executeQuery();
        while (resSet.next()) {
            System.out.println(resSet.getString(1));
        }
        System.out.println("Done");
        dbCon.close();
</code>```

Maven dependency for JTDS driver:

```<code>        <dependency>
           <groupId>net.sourceforge.jtds</groupId>
           <artifactId>jtds</artifactId>
           <version>1.3.1</version>
        </dependency>
</code>```

BTW: Maybe there is a newer version available...

Body:
Some time back I had problems with Microsoft JDBC Driver and used open source JTDS. I do not remember exact problems, but JTDS worked just fine for me.

So, code to connect to database may look like:

        //Not required anymore - just for demonstration. Driver class must be in class path
        Class.forName("net.sourceforge.jtds.jdbc.Driver");

        Connection dbCon = DriverManager
                .getConnection("jdbc:jtds:sqlserver://{db_host}:[db_port]/{Database Name};domain={user Windows domain};user={user id};password={user password}");
        PreparedStatement stmt = dbCon.prepareStatement("SELECT GETDATE()");
        ResultSet resSet = stmt.executeQuery();
        while (resSet.next()) {
            System.out.println(resSet.getString(1));
        }
        System.out.println("Done");
        dbCon.close();

Maven dependency for JTDS driver:

        <dependency>
           <groupId>net.sourceforge.jtds</groupId>
           <artifactId>jtds</artifactId>
           <version>1.3.1</version>
        </dependency>

BTW: Maybe there is a newer version available...


问:
Ruby on Rails with Heroku: fatal: No configured push destination
I'm trying to deploy my app with Heroku, I'm using a tutorial from YouTube and I'm stuck on a part in the tutorial that tells you to enter in the terminal...

```<code>git push
</code>```

after many other commands. When I did enter that command, I get the following message

```<code>fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>
</code>```

I'm not sure what to put in, what do I have to put in?

In case you are wondering, I'm using the tutorial with the below link
https://www.youtube.com/watch?v=mabGJ-vuABc

答:
What the error from the command is telling you is that there's no configured place to send your code to. What this means in the context of your problem is that you have not set up the URL in your repo for your Heroku app.

You can double check this by running git remote -v which should not contain an output or at least one that has a heroku url on it.

To fix this, go to your Heroku app instance and look for the .git url for the application. This provides an address to which you can push your application to.

Once you have that, you should be able to do the following

```<code>git remote add heroku https://git.heroku.com/<your-app-name>.git
</code>```

This will create a remote called heroku which will point to the URL provided by your application to your application's repo in Heroku.

Then to push your code you can run:

```<code>git push heroku master
</code>```

Body:
I'm trying to deploy my app with Heroku, I'm using a tutorial from YouTube and I'm stuck on a part in the tutorial that tells you to enter in the terminal...

git push

after many other commands. When I did enter that command, I get the following message

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

I'm not sure what to put in, what do I have to put in?

In case you are wondering, I'm using the tutorial with the below link
https://www.youtube.com/watch?v=mabGJ-vuABc

Body:
What the error from the command is telling you is that there's no configured place to send your code to. What this means in the context of your problem is that you have not set up the URL in your repo for your Heroku app.

You can double check this by running git remote -v which should not contain an output or at least one that has a heroku url on it.

To fix this, go to your Heroku app instance and look for the .git url for the application. This provides an address to which you can push your application to.

Once you have that, you should be able to do the following

git remote add heroku https://git.heroku.com/<your-app-name>.git

This will create a remote called heroku which will point to the URL provided by your application to your application's repo in Heroku.

Then to push your code you can run:

git push heroku master


问:
Maven2: Missing artifact but jars are in place
From now to then, my Maven 2 started to mess around.

I am using SPring STS 2.6.1 and have a single project based on Spring 3, Hibernate, DWR, Cometd and all that stuff.

Today I just updated from Git und all of a sudden, I got that scary mvn exclamation mark (!) next to my project.

After hitting "Project -> Maven -> Update dependencies" I just receive:

```<code>24.05.11 15:26:58 MESZ: Missing artifact org.jdom:jdom:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-common:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-core:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-solrj:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact stax:stax:jar:1.2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact stax:stax-api:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-analyzers:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-core:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-highlighter:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-queries:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-snowball:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-spellchecker:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-httpclient:commons-httpclient:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.commons:commons-io:jar:1.3.2:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-logging:commons-logging:jar:1.0.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-commons-csv:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.java.dev.stax-utils:stax-utils:jar:20040917:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.lucene:lucene-snowball:jar:2.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.lucene:lucene-core:jar:2.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.slf4j:slf4j-api:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-core:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact aopalliance:aopalliance:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-test:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-context:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-oxm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-web:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-instrument:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-web:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-taglibs:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-parent:pom:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-config:jar:3.0.5.RELEASE:system
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-core:jar:3.3.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact antlr:antlr:jar:2.7.6:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-collections:commons-collections:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact dom4j:dom4j:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.transaction:jta:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:ejb3-persistence:pom:1.0.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-dbcp:commons-dbcp:jar:1.4:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-pool:commons-pool:jar:1.5.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.aspectj:aspectjweaver:jar:1.6.10:compile
24.05.11 15:26:58 MESZ: Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact log4j:log4j:jar:1.2.16:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.persistence:persistence-api:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact javassist:javassist:jar:3.12.1.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact postgresql:postgresql:jar:9.0-801.jdbc4:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-codec:commons-codec:jar:1.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.directwebremoting:dwr:jar:2.0.3:compile
24.05.11 15:26:58 MESZ: Missing artifact org.beanshell:bsh:jar:2.0b4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.jasypt:jasypt:jar:1.7:compile
24.05.11 15:26:58 MESZ: Missing artifact cglib:cglib:jar:2.2:compile
24.05.11 15:26:58 MESZ: Missing artifact asm:asm:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-fileupload:commons-fileupload:jar:1.2.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.poi:poi:jar:3.8-beta1:compile
24.05.11 15:26:58 MESZ: Missing artifact jasperreports:jasperreports:jar:3.5.3:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-beanutils:commons-beanutils:jar:1.8.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-digester:commons-digester:jar:1.7:compile
24.05.11 15:26:58 MESZ: Missing artifact jfree:jcommon:jar:1.0.15:compile
24.05.11 15:26:58 MESZ: Missing artifact jfree:jfreechart:jar:1.0.12:compile
24.05.11 15:26:58 MESZ: Missing artifact xml-apis:xml-apis:jar:1.3.02:compile
24.05.11 15:26:58 MESZ: Missing artifact eclipse:jdtcore:jar:3.1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact junit:junit:jar:4.8.2:test
24.05.11 15:26:58 MESZ: Missing artifact org.easymock:easymock:jar:3.0:test
24.05.11 15:26:58 MESZ: Missing artifact cglib:cglib-nodep:jar:2.2:test
24.05.11 15:26:58 MESZ: Missing artifact org.objenesis:objenesis:jar:1.2:test
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache:pom:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache-core:jar:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache-terracotta:jar:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.opensymphony.quartz:quartz-all:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.servlet:jstl:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact taglibs:standard:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.aspectj:aspectjrt:jar:1.6.5:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.velocity:velocity:jar:1.6.2:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-lang:commons-lang:jar:2.4:compile
24.05.11 15:26:58 MESZ: Missing artifact oro:oro:jar:2.0.8:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.mail:mail:jar:1.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.activation:activation:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact com.lowagie:itext:jar:2.0.7:compile
24.05.11 15:26:58 MESZ: Missing artifact bouncycastle:bcmail-jdk14:jar:138:compile
24.05.11 15:26:58 MESZ: Missing artifact bouncycastle:bcprov-jdk14:jar:138:compile
24.05.11 15:26:58 MESZ: Missing artifact org.cometd.java:cometd-java-server:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.cometd.java:cometd-api:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.eclipse.jetty:jetty-util:jar:7.0.1.v20091125:compile
24.05.11 15:26:58 MESZ: Missing artifact org.eclipse.jetty:jetty-continuation:jar:7.0.1.v20091125:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.velocity:velocity-tools:jar:2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-chain:commons-chain:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-validator:commons-validator:jar:1.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact sslext:sslext:jar:1.2-0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-core:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-taglib:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-tiles:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact net.htmlparser.jericho:jericho-html:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact ro.isdc.wro4j:wro4j-core:jar:1.3.3:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-io:commons-io:jar:2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact com.google.collections:google-collections:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.servlet:servlet-api:jar:2.5:compile
24.05.11 15:26:58 MESZ: Missing artifact redis.clients:jedis:jar:1.5.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.mongodb:mongo-java-driver:jar:2.5.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.xhtmlrenderer:core-renderer:jar:R8pre2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.sanselan:sanselan:jar:0.97-incubator:compile
24.05.11 15:26:58 MESZ: Missing artifact com.kenai.nbpwr:com-sun-pdfview:jar:1.0.5-201003191900:compile
24.05.11 15:26:58 MESZ: Missing artifact org.swinglabs:pdf-renderer:jar:1.0.5:compile
24.05.11 15:26:58 MESZ: Missing artifact org.safehaus.jug:jug:jar:2.0.0:system
24.05.11 15:26:58 MESZ: Missing artifact de.dankomannhaupt:JDBCAppender:jar:1.0:system
24.05.11 15:26:58 MESZ: Missing artifact spy:memcahed:jar:2.5:system
24.05.11 15:26:58 MESZ: Missing artifact net.sf.beanlib:beanlib:jar:5.0.2beta:compile
24.05.11 15:26:58 MESZ: Missing artifact xstream:xstream:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact net.jcip:jcip-annotations:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.beanlib:beanlib-hibernate:jar:5.0.2beta:compile
</code>```

My pom.xml looks like:

```<code><properties>
        <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
        <hibernate.version>3.3.2.GA</hibernate.version>
    </properties>

    <repositories>
        <repository>
            <id>JBoss</id>
            <name>JBoss Repsitory</name>
            <layout>default</layout>
            <url>http://repository.jboss.org/maven2</url>
        </repository>
    </repositories>
    <!-- Bezeichnung -->
    <artifactId>project-dao</artifactId>
    <name>Vevention Dao</name>
    <groupId>com.corp.dao</groupId>
    <version>1.0Beta</version>

    <dependencies>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aspects</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context-support</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-oxm</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-instrument</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${org.springframework.version}</version>
            <scope>system</scope>
            <systemPath>${basedir}/lib/spring-security-config-3.0.5.RELEASE.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.4.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>ejb3-persistence</artifactId>
            <version>1.0.2.GA</version>
            <type>pom</type>
        </dependency>
<dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>3.1.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-common</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-snowball</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.0.1B</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.6.SEC01</version>
        </dependency>
        <dependency>
            <groupId>memcached</groupId>
            <artifactId>memcached</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.5</version>
        </dependency>
         <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>1.5.2</version>
        </dependency>

        <dependency>
            <groupId>voldemort</groupId>
            <artifactId>voldemort</artifactId>
            <version>0.81</version>
        </dependency>

    </dependencies>
</project>
</code>```

I then checked on my Mac /Users/XYZ/.m2 and all jar files are in place as expected.

I am using the current Maven release shipped with STS. I also enabled debug output but there was nothing suspicious.

答:
I have seen a bug that manifested as "Error installing artifact: File ../null/... does not exist" (that is, the file was not found because there was "null" in the path). The reason was that one environment variable was not visible to maven. It was:

```<code>JV_SRCROOT=$DIRECTORY
</code>```

instead of

```<code>export JV_SRCROOT=$DIRECTORY
</code>```

(in the latter case the variable is visible to child processes)

Body:
From now to then, my Maven 2 started to mess around.

I am using SPring STS 2.6.1 and have a single project based on Spring 3, Hibernate, DWR, Cometd and all that stuff.

Today I just updated from Git und all of a sudden, I got that scary mvn exclamation mark (!) next to my project.

After hitting "Project -> Maven -> Update dependencies" I just receive:

24.05.11 15:26:58 MESZ: Missing artifact org.jdom:jdom:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-common:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-core:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-solrj:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact stax:stax:jar:1.2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact stax:stax-api:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-analyzers:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-core:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-highlighter:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-queries:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-snowball:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-lucene-spellchecker:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-httpclient:commons-httpclient:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.commons:commons-io:jar:1.3.2:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-logging:commons-logging:jar:1.0.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.solr:solr-commons-csv:jar:1.3.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.java.dev.stax-utils:stax-utils:jar:20040917:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.lucene:lucene-snowball:jar:2.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.lucene:lucene-core:jar:2.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.slf4j:slf4j-api:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-core:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact aopalliance:aopalliance:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-test:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-context:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-oxm:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-web:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework:spring-instrument:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-web:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-taglibs:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-parent:pom:3.0.5.RELEASE:compile
24.05.11 15:26:58 MESZ: Missing artifact org.springframework.security:spring-security-config:jar:3.0.5.RELEASE:system
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-core:jar:3.3.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact antlr:antlr:jar:2.7.6:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-collections:commons-collections:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact dom4j:dom4j:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.transaction:jta:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact org.hibernate:ejb3-persistence:pom:1.0.2.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-dbcp:commons-dbcp:jar:1.4:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-pool:commons-pool:jar:1.5.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.aspectj:aspectjweaver:jar:1.6.10:compile
24.05.11 15:26:58 MESZ: Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact log4j:log4j:jar:1.2.16:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.persistence:persistence-api:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact javassist:javassist:jar:3.12.1.GA:compile
24.05.11 15:26:58 MESZ: Missing artifact postgresql:postgresql:jar:9.0-801.jdbc4:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-codec:commons-codec:jar:1.4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.directwebremoting:dwr:jar:2.0.3:compile
24.05.11 15:26:58 MESZ: Missing artifact org.beanshell:bsh:jar:2.0b4:compile
24.05.11 15:26:58 MESZ: Missing artifact org.jasypt:jasypt:jar:1.7:compile
24.05.11 15:26:58 MESZ: Missing artifact cglib:cglib:jar:2.2:compile
24.05.11 15:26:58 MESZ: Missing artifact asm:asm:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-fileupload:commons-fileupload:jar:1.2.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.poi:poi:jar:3.8-beta1:compile
24.05.11 15:26:58 MESZ: Missing artifact jasperreports:jasperreports:jar:3.5.3:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-beanutils:commons-beanutils:jar:1.8.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-digester:commons-digester:jar:1.7:compile
24.05.11 15:26:58 MESZ: Missing artifact jfree:jcommon:jar:1.0.15:compile
24.05.11 15:26:58 MESZ: Missing artifact jfree:jfreechart:jar:1.0.12:compile
24.05.11 15:26:58 MESZ: Missing artifact xml-apis:xml-apis:jar:1.3.02:compile
24.05.11 15:26:58 MESZ: Missing artifact eclipse:jdtcore:jar:3.1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact junit:junit:jar:4.8.2:test
24.05.11 15:26:58 MESZ: Missing artifact org.easymock:easymock:jar:3.0:test
24.05.11 15:26:58 MESZ: Missing artifact cglib:cglib-nodep:jar:2.2:test
24.05.11 15:26:58 MESZ: Missing artifact org.objenesis:objenesis:jar:1.2:test
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache:pom:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache-core:jar:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.ehcache:ehcache-terracotta:jar:2.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.opensymphony.quartz:quartz-all:jar:1.6.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.servlet:jstl:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact taglibs:standard:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.aspectj:aspectjrt:jar:1.6.5:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.velocity:velocity:jar:1.6.2:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-lang:commons-lang:jar:2.4:compile
24.05.11 15:26:58 MESZ: Missing artifact oro:oro:jar:2.0.8:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.mail:mail:jar:1.4.1:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.activation:activation:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact com.lowagie:itext:jar:2.0.7:compile
24.05.11 15:26:58 MESZ: Missing artifact bouncycastle:bcmail-jdk14:jar:138:compile
24.05.11 15:26:58 MESZ: Missing artifact bouncycastle:bcprov-jdk14:jar:138:compile
24.05.11 15:26:58 MESZ: Missing artifact org.cometd.java:cometd-java-server:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.cometd.java:cometd-api:jar:1.0.1:compile
24.05.11 15:26:58 MESZ: Missing artifact org.eclipse.jetty:jetty-util:jar:7.0.1.v20091125:compile
24.05.11 15:26:58 MESZ: Missing artifact org.eclipse.jetty:jetty-continuation:jar:7.0.1.v20091125:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.velocity:velocity-tools:jar:2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-chain:commons-chain:jar:1.1:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-validator:commons-validator:jar:1.3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact sslext:sslext:jar:1.2-0:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-core:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-taglib:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.struts:struts-tiles:jar:1.3.8:compile
24.05.11 15:26:58 MESZ: Missing artifact net.htmlparser.jericho:jericho-html:jar:3.1:compile
24.05.11 15:26:58 MESZ: Missing artifact ro.isdc.wro4j:wro4j-core:jar:1.3.3:compile
24.05.11 15:26:58 MESZ: Missing artifact commons-io:commons-io:jar:2.0:compile
24.05.11 15:26:58 MESZ: Missing artifact com.google.collections:google-collections:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact javax.servlet:servlet-api:jar:2.5:compile
24.05.11 15:26:58 MESZ: Missing artifact redis.clients:jedis:jar:1.5.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.mongodb:mongo-java-driver:jar:2.5.2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.xhtmlrenderer:core-renderer:jar:R8pre2:compile
24.05.11 15:26:58 MESZ: Missing artifact org.apache.sanselan:sanselan:jar:0.97-incubator:compile
24.05.11 15:26:58 MESZ: Missing artifact com.kenai.nbpwr:com-sun-pdfview:jar:1.0.5-201003191900:compile
24.05.11 15:26:58 MESZ: Missing artifact org.swinglabs:pdf-renderer:jar:1.0.5:compile
24.05.11 15:26:58 MESZ: Missing artifact org.safehaus.jug:jug:jar:2.0.0:system
24.05.11 15:26:58 MESZ: Missing artifact de.dankomannhaupt:JDBCAppender:jar:1.0:system
24.05.11 15:26:58 MESZ: Missing artifact spy:memcahed:jar:2.5:system
24.05.11 15:26:58 MESZ: Missing artifact net.sf.beanlib:beanlib:jar:5.0.2beta:compile
24.05.11 15:26:58 MESZ: Missing artifact xstream:xstream:jar:1.1.2:compile
24.05.11 15:26:58 MESZ: Missing artifact net.jcip:jcip-annotations:jar:1.0:compile
24.05.11 15:26:58 MESZ: Missing artifact net.sf.beanlib:beanlib-hibernate:jar:5.0.2beta:compile

My pom.xml looks like:

<properties>
        <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
        <hibernate.version>3.3.2.GA</hibernate.version>
    </properties>

    <repositories>
        <repository>
            <id>JBoss</id>
            <name>JBoss Repsitory</name>
            <layout>default</layout>
            <url>http://repository.jboss.org/maven2</url>
        </repository>
    </repositories>

    <artifactId>project-dao</artifactId>
    <name>Vevention Dao</name>
    <groupId>com.corp.dao</groupId>
    <version>1.0Beta</version>

    <dependencies>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aspects</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context-support</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-oxm</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-instrument</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
         <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${org.springframework.version}</version>
         </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${org.springframework.version}</version>
            <scope>system</scope>
            <systemPath>${basedir}/lib/spring-security-config-3.0.5.RELEASE.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.4.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>ejb3-persistence</artifactId>
            <version>1.0.2.GA</version>
            <type>pom</type>
        </dependency>
<dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>3.1.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-common</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-snowball</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.0.1B</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.6.SEC01</version>
        </dependency>
        <dependency>
            <groupId>memcached</groupId>
            <artifactId>memcached</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.5</version>
        </dependency>
         <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>1.5.2</version>
        </dependency>

        <dependency>
            <groupId>voldemort</groupId>
            <artifactId>voldemort</artifactId>
            <version>0.81</version>
        </dependency>

    </dependencies>
</project>

I then checked on my Mac /Users/XYZ/.m2 and all jar files are in place as expected.

I am using the current Maven release shipped with STS. I also enabled debug output but there was nothing suspicious.

Body:
I have seen a bug that manifested as "Error installing artifact: File ../null/... does not exist" (that is, the file was not found because there was "null" in the path). The reason was that one environment variable was not visible to maven. It was:

JV_SRCROOT=$DIRECTORY

instead of

export JV_SRCROOT=$DIRECTORY

(in the latter case the variable is visible to child processes)


问:
MVC routes.MapRoute name property
I'm brand new to MVC so please bear with me as I'm only on the second page of the MS Tutorial (see last code example). For the HelloWorldController the following MapRoute is added:

```<code>routes.MapRoute(
                name: "Hello",
                url: "{controller}/{action}/{name}/{id}");
</code>```

I'm just wondering, is it purely the pattern matching that does the work and the name "Hello" is just for my own reference? If so, are there not naming conventions that should be followed saying the MapRoute should be called HelloWorldWelcome, where welcome is a method inside the HelloWorldController.cs (see above link). Or am i being pedantic?

答:
```<code>routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "ImageScan", action = "ScanImage", id = UrlParameter.Optional },
                        namespaces: new[] { "WebApplication3.Controllers" }
        );
</code>```

I am finding error :
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Views/ImageScan/ScanImage.cshtml

Title: MVC routes.MapRoute name property

Body:
I'm brand new to MVC so please bear with me as I'm only on the second page of the MS Tutorial (see last code example). For the HelloWorldController the following MapRoute is added:

routes.MapRoute(
                name: "Hello",
                url: "{controller}/{action}/{name}/{id}");

I'm just wondering, is it purely the pattern matching that does the work and the name "Hello" is just for my own reference? If so, are there not naming conventions that should be followed saying the MapRoute should be called HelloWorldWelcome, where welcome is a method inside the HelloWorldController.cs (see above link). Or am i being pedantic?

Body:
routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "ImageScan", action = "ScanImage", id = UrlParameter.Optional },
                        namespaces: new[] { "WebApplication3.Controllers" }
        );

I am finding error :
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Views/ImageScan/ScanImage.cshtml


问:
Make new line in GraphDSL
I´m pretty new in GraphDSL of akka stream. I´m doing DSL for a test framework that we have, so far so good, but I´m facing the problem that I cannot have a new line when people use the DSL

here an example:

```<code>Given("A url='http://localhost:8080/hello_dls_world'") ~> When(s"I make a request") ~> AndThen("I expect to receive 200")
</code>```

As you can see the line it´s big and could be even worst.

Using the builder I create a solution, but I dont think it´s really nice

```<code>object TestDSL extends MainDSL with App {

  import GraphDSL.Implicits._

  val runnableGraph = RunnableGraph.fromGraph(GraphDSL.create() { implicit builder =>

    val in = newLine(builder).in
    val out = newLine(builder).out

    Given("This_is_a_hello_world") ~> When(s"I change character _") ~> in

    out ~> AndThen("I expect to receive 200") ~> Then("I expect to receive 200")

    ClosedShape
  })

  runnableGraph.run()
}
</code>```

This is my DSL implementation

```<code>   class MainDSL {

  implicit val system = ActorSystem()
  implicit val materializer = ActorMaterializer()

  def Given(sentence: String) = Source.single(sentence.toUpperCase)

  def When(sentence: String) = Flow[Any].map(x => x.asInstanceOf[String].replace("_", " "))

  def Then(sentence: String) = Sink.foreach[Any](x => println(s"######## $x"))

  def AndThen(sentence: String) = Flow[Any].map(x => x)

  def newLine(builder: Builder[NotUsed]) = builder.add(Flow[Any].map(x => x))

}
</code>```

Somebody here can give me a better solution please?

When I run it I receive this error

```<code>Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: The inlets [] and outlets [] must correspond to the inlets [Map.in] and outlets [Map.out]
    at scala.Predef$.require(Predef.scala:224)
    at akka.stream.Shape.requireSamePortsAs(Shape.scala:168)
    at akka.stream.impl.StreamLayout$CompositeModule.replaceShape(StreamLayout.scala:427)
    at akka.stream.scaladsl.GraphApply$class.create(GraphApply.scala:19)
    at akka.stream.scaladsl.GraphDSL$.create(Graph.scala:993)
    at stream.dsl.TestDSL$.delayedEndpoint$stream$dsl$TestDSL$1(TestDSL.scala:22)
    at stream.dsl.TestDSL$delayedInit$body.apply(TestDSL.scala:18)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.App$class.main(App.scala:76)
    at stream.dsl.TestDSL$.main(TestDSL.scala:18)
    at stream.dsl.TestDSL.main(TestDSL.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
</code>```

Regards

答:
You should be able to split by specifying in and out ports of your flows' shape, e.g.

```<code>val when = builder.add(When(s"I change character _"))

Given("This_is_a_hello_world") ~> when.in
when.out ~> AndThen("I expect to receive 200")
</code>```

Title: Make new line in GraphDSL

Body:
I´m pretty new in GraphDSL of akka stream. I´m doing DSL for a test framework that we have, so far so good, but I´m facing the problem that I cannot have a new line when people use the DSL

here an example:

Given("A url='http://localhost:8080/hello_dls_world'") ~> When(s"I make a request") ~> AndThen("I expect to receive 200")

As you can see the line it´s big and could be even worst.

Using the builder I create a solution, but I dont think it´s really nice

object TestDSL extends MainDSL with App {

  import GraphDSL.Implicits._

  val runnableGraph = RunnableGraph.fromGraph(GraphDSL.create() { implicit builder =>

    val in = newLine(builder).in
    val out = newLine(builder).out

    Given("This_is_a_hello_world") ~> When(s"I change character _") ~> in

    out ~> AndThen("I expect to receive 200") ~> Then("I expect to receive 200")

    ClosedShape
  })

  runnableGraph.run()
}

This is my DSL implementation

   class MainDSL {

  implicit val system = ActorSystem()
  implicit val materializer = ActorMaterializer()

  def Given(sentence: String) = Source.single(sentence.toUpperCase)

  def When(sentence: String) = Flow[Any].map(x => x.asInstanceOf[String].replace("_", " "))

  def Then(sentence: String) = Sink.foreach[Any](x => println(s"######## $x"))

  def AndThen(sentence: String) = Flow[Any].map(x => x)

  def newLine(builder: Builder[NotUsed]) = builder.add(Flow[Any].map(x => x))

}

Somebody here can give me a better solution please?

When I run it I receive this error

Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: The inlets [] and outlets [] must correspond to the inlets [Map.in] and outlets [Map.out]
    at scala.Predef$.require(Predef.scala:224)
    at akka.stream.Shape.requireSamePortsAs(Shape.scala:168)
    at akka.stream.impl.StreamLayout$CompositeModule.replaceShape(StreamLayout.scala:427)
    at akka.stream.scaladsl.GraphApply$class.create(GraphApply.scala:19)
    at akka.stream.scaladsl.GraphDSL$.create(Graph.scala:993)
    at stream.dsl.TestDSL$.delayedEndpoint$stream$dsl$TestDSL$1(TestDSL.scala:22)
    at stream.dsl.TestDSL$delayedInit$body.apply(TestDSL.scala:18)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.App$class.main(App.scala:76)
    at stream.dsl.TestDSL$.main(TestDSL.scala:18)
    at stream.dsl.TestDSL.main(TestDSL.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Regards

Body:
You should be able to split by specifying in and out ports of your flows' shape, e.g.

val when = builder.add(When(s"I change character _"))

Given("This_is_a_hello_world") ~> when.in
when.out ~> AndThen("I expect to receive 200")


问:
In Python How Do I re-organise inconsistent columns from Excel?
I have got a bunch of reports, all containing the same information, but the columns are inconsistent in order and titles, so when I run the functions to parse the information I am not getting out what I want.

How can I use python to organise the columns in a consistent way to work with later down the line?

Currently the columns look like;

```<code>['Comment', 'Rec Date', 'Receipt Number', 'Rec Amt', 'Receipt Method', 'Status']
['Comment', 'State', 'Rec No', 'Rec Date', 'Rec Amt', 'Status']
['Receipt Number', 'Rec Date', 'Rec Amt', 'Comment', 'State', 'Status']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'State', 'Rec Method']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'Receipt Method', 'State']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'State', 'Rec Method']
</code>```

I would like all of these categories to be included as columns. (Points that don't have a value for a specific column would get some placeholder or empty value.)

答:
First read_excel for DataFrame:

```<code>df = pd.read_excel('file.xlsx')
</code>```

I believe you need rename columns by dict and then sort them by sort_index:

```<code>d = {'Rec No':'Receipt Number', 'Rec Method':'Receipt Method',...}
df = df.rename(columns=d).sort_index(axis=1)
</code>```

Body:
I have got a bunch of reports, all containing the same information, but the columns are inconsistent in order and titles, so when I run the functions to parse the information I am not getting out what I want.

How can I use python to organise the columns in a consistent way to work with later down the line?

Currently the columns look like;

['Comment', 'Rec Date', 'Receipt Number', 'Rec Amt', 'Receipt Method', 'Status']
['Comment', 'State', 'Rec No', 'Rec Date', 'Rec Amt', 'Status']
['Receipt Number', 'Rec Date', 'Rec Amt', 'Comment', 'State', 'Status']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'State', 'Rec Method']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'Receipt Method', 'State']
['Comment', 'Receipt Number', 'Rec Date', 'Rec Amt', 'State', 'Rec Method']

I would like all of these categories to be included as columns. (Points that don't have a value for a specific column would get some placeholder or empty value.)

Body:
First read_excel for DataFrame:

df = pd.read_excel('file.xlsx')

I believe you need rename columns by dict and then sort them by sort_index:

d = {'Rec No':'Receipt Number', 'Rec Method':'Receipt Method',...}
df = df.rename(columns=d).sort_index(axis=1)


问:
mongo-connector with neo4j_doc_manager seems to be hanging
I have a currently empty MongoDB instance that I am trying to connect to a Neo4j instance (also empty). I have installed MongoDB, Neo4j, python, mongo-connector, and Neo4j Doc Manager, but I cannot seem to get past

```<code>mongo-connector -m localhost:27017 -t http://localhost:7474/db/data -d neo4j_doc_manager
</code>```

I open Windows PowerShell as Administrator and start MongoDB with:

```<code>.\mongod --replSet myDevReplSet
</code>```

which appears to start correctly. It indicates that it is waiting for connections on port 27017 and then goes on to "transition to PRIMARY" and "database writes are now permitted." So I open a second Windows PowerShell as Administrator and type

```<code>.\mongo
</code>```

The shell indicates that it connected to test and shows

```<code>myDevReplSet:PRIMARY>
</code>```

So then I type in the mongo-connector line (above) and am met with

```<code>...
</code>```

And it just seems to sit there eternally. Neo4j is up and running through all of this.

I'm sure I've missed a very small, very crucial piece, but I can't seem to find it. I've gone back through all the documentation I could find and scoured the internet to no avail. All parts are installed with the default settings and ports. I've checked that both the MongoDB and Neo4j port numbers are correct. For reference, I'm using the documentation from Neo4j and MongoDB.

I am running all of this on a fresh Windows 10 virtual machine with the latest versions of all five pieces of software (downloaded from the respective sites today). I created a json file from the CSV files included in the tutorial that comes with Neo4j (Northwind database files) that I was trying to load into MongoDB and then see in Neo4j. Unfortunately, I'm never getting that far.

Can anyone please show me what I am doing wrong?

Thanks in advance.

答: You tried to run mongo-connector within mongo. You need to call mongo-connector from a new command prompt. mongo-connector is a separate program (that you might have previously installed via pip).</p>

Body:
I have a currently empty MongoDB instance that I am trying to connect to a Neo4j instance (also empty). I have installed MongoDB, Neo4j, python, mongo-connector, and Neo4j Doc Manager, but I cannot seem to get past

mongo-connector -m localhost:27017 -t http://localhost:7474/db/data -d neo4j_doc_manager

I open Windows PowerShell as Administrator and start MongoDB with:

.\mongod --replSet myDevReplSet

which appears to start correctly. It indicates that it is waiting for connections on port 27017 and then goes on to "transition to PRIMARY" and "database writes are now permitted." So I open a second Windows PowerShell as Administrator and type

.\mongo

The shell indicates that it connected to test and shows

myDevReplSet:PRIMARY>

So then I type in the mongo-connector line (above) and am met with

...

And it just seems to sit there eternally. Neo4j is up and running through all of this.

I'm sure I've missed a very small, very crucial piece, but I can't seem to find it. I've gone back through all the documentation I could find and scoured the internet to no avail. All parts are installed with the default settings and ports. I've checked that both the MongoDB and Neo4j port numbers are correct. For reference, I'm using the documentation from Neo4j and MongoDB.

I am running all of this on a fresh Windows 10 virtual machine with the latest versions of all five pieces of software (downloaded from the respective sites today). I created a json file from the CSV files included in the tutorial that comes with Neo4j (Northwind database files) that I was trying to load into MongoDB and then see in Neo4j. Unfortunately, I'm never getting that far.

Can anyone please show me what I am doing wrong?

Thanks in advance.