通过resolver删除指定的联系人

resolver查询或者删除通讯录指定姓名联系人时候,为什么姓名必须要设置成常量的
形式,变量就不行呢?我的代码中如果name="shanshan"常量的形式,就能够删除
成功,name如果是从textview中输入的姓名的值获取而来的删除就不成功呢?

代码如下:
name = tv_name.getText().toString();
// 设置你的操作事项
//删除通讯录中的联系人
//delete(i,name);
ContentResolver resolver = getContentResolver();
Uri uri = Uri.parse("content://com.android.contacts/contacts");
Cursor cursor = resolver.query(uri,new String[]{"display_name"},ContactsContract.Data.DISPLAY_NAME+"= ?",new String[]{name},null);
//Cursor cursor=resolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME+"="+name, null, null);
int b = cursor.getCount();
System.out.println(b);
if (cursor.moveToFirst()) {
int id = cursor.getInt(0);
// 根据id删除data中的相应数据
resolver.delete(RawContacts.CONTENT_URI, "display_name=?",new String[]{name});
uri = Uri.parse("content://com.android.contacts/data");
resolver.delete(Contacts.CONTENT_URI, "display_name=?",new String[] {name });
}
这样子不会成功,name换成通讯录里面有的联系人的名字,即可删除成功,为什么?

1个回答

删除的时候需要进行字符串的匹配,你确定输入的字符串和通讯录里面的能对上吗?最好把名字log出来,或者用 .equals方法对比下是不是相等。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
找不到net.Resolver

<div class="post-text" itemprop="text"> <p>I have installed go 1.7 in Debian to make <a href="https://github.com/m13253/dns-over-https" rel="nofollow noreferrer">doh</a></p> <p>It has a Makefile, which triggers the download and install of dependencies into my <code>GOPATH</code>.</p> <p>The <code>net</code> package is there:</p> <pre><code>$ ls $GOPATH/src/github.com/golang/net/ AUTHORS context dict http idna ipv6 lif PATENTS README.md webdav bpf CONTRIBUTING.md dns http2 internal lex nettest proxy route websocket codereview.cfg CONTRIBUTORS html icmp ipv4 LICENSE netutil publicsuffix trace xsrftoken </code></pre> <p>Yet during the build, it says it cannot find net.Resolver</p> <pre><code>$ make go get -d -v ./doh-client ./doh-server cd doh-client &amp;&amp; go build # _/home/share/apps/dns-over-https/doh-client ./client.go:47: undefined: net.Resolver Makefile:46: recipe for target 'doh-client/doh-client' failed make: *** [doh-client/doh-client] Error 2 </code></pre> <p>This is my first go with go, so I am not sure how it goes about pulling in imports, and whether the Resolver part is present.</p> </div>

做一个安卓实验,读取通讯录并添加联系人。在添加联系人的时候,发现添加的联系人信息是空的!

做一个安卓实验,读取通讯录并添加联系人。在添加联系人的时候,发现添加的联系人信息是空的![图片说明](https://img-ask.csdn.net/upload/201712/02/1512201984_645899.jpg) ![图片说明](https://img-ask.csdn.net/upload/201712/02/1512201996_845183.png) ``` public class AddContactActivity extends AppCompatActivity { private EditText nameEdit; private EditText phonenumberEdit; private Button add; private Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_contact); nameEdit = (EditText) findViewById(R.id.name); phonenumberEdit = (EditText) findViewById(R.id.phonenumber); add = (Button) findViewById(R.id.add); toolbar = (Toolbar) findViewById(R.id.toolbar_addcontact); //Toolbar setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); add.setOnClickListener(new View.OnClickListener() { String name = nameEdit.getText().toString().trim(); String phonenumber = phonenumberEdit.getText().toString(); @Override public void onClick(View v) { ContentResolver resolver = getContentResolver(); Uri uri = Uri.parse("content://com.android.contacts/raw_contacts"); Uri datauri = Uri.parse("content://com.android.contacts/data"); Cursor cursor = resolver.query(uri, null, null, null, null); int count = cursor.getCount(); ContentValues values = new ContentValues(); int contact_id = count + 1; values.put("contact_id", contact_id); resolver.insert(uri, values); //插入具体的数据到data表,数据类型,data1具体的数据 ContentValues namevalue = new ContentValues(); namevalue.put("mimetype", "vnd.android.cursor.item/name"); // 指定数据类型 namevalue.put("data1", name); namevalue.put("raw_contact_id", contact_id); // 一定要记得指定数据属于哪个联系人 resolver.insert(datauri, namevalue); ContentValues phonevalue = new ContentValues(); phonevalue.put("mimetype", "vnd.android.cursor.item/phone_v2"); phonevalue.put("data1",phonenumber); phonevalue.put("raw_contact_id", contact_id); resolver.insert(datauri, phonevalue); Toast.makeText(AddContactActivity.this, "添加成功", Toast.LENGTH_SHORT).show(); } }); } } ``` 但是把上面要添加的联系人信息由从EditText中读取改为直接给定时,发现联系人信息可以添加了 ![图片说明](https://img-ask.csdn.net/upload/201712/02/1512202265_997024.jpg) ![图片说明](https://img-ask.csdn.net/upload/201712/02/1512202279_368493.png) ``` public class AddContactActivity extends AppCompatActivity { private EditText nameEdit; private EditText phonenumberEdit; private Button add; private Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_contact); nameEdit = (EditText) findViewById(R.id.name); phonenumberEdit = (EditText) findViewById(R.id.phonenumber); add = (Button) findViewById(R.id.add); toolbar = (Toolbar) findViewById(R.id.toolbar_addcontact); //Toolbar setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); add.setOnClickListener(new View.OnClickListener() { String name = nameEdit.getText().toString().trim(); String phonenumber = phonenumberEdit.getText().toString(); @Override public void onClick(View v) { ContentResolver resolver = getContentResolver(); Uri uri = Uri.parse("content://com.android.contacts/raw_contacts"); Uri datauri = Uri.parse("content://com.android.contacts/data"); Cursor cursor = resolver.query(uri, null, null, null, null); int count = cursor.getCount(); ContentValues values = new ContentValues(); int contact_id = count + 1; values.put("contact_id", contact_id); resolver.insert(uri, values); //插入具体的数据到data表,数据类型,data1具体的数据 ContentValues namevalue = new ContentValues(); namevalue.put("mimetype", "vnd.android.cursor.item/name"); // 指定数据类型 namevalue.put("data1", "Android"); namevalue.put("raw_contact_id", contact_id); // 一定要记得指定数据属于哪个联系人 resolver.insert(datauri, namevalue); ContentValues phonevalue = new ContentValues(); phonevalue.put("mimetype", "vnd.android.cursor.item/phone_v2"); phonevalue.put("data1","1234567890"); phonevalue.put("raw_contact_id", contact_id); resolver.insert(datauri, phonevalue); Toast.makeText(AddContactActivity.this, "添加成功", Toast.LENGTH_SHORT).show(); } }); } } ``` 不明白为什么,求大佬解答啊

android在添加手机联系人(一个联系人多个号码)的时,当手机号码改变时,会生成另一个相同联系人

//添加联系人名字 String target_name = name; values.put("raw_contact_id", contactId); values.put(ContactsContract.RawContacts.Data.MIMETYPE, "vnd.android.cursor.item/name"); values.put("data1", target_name); resolver.insert(uri, values); values.clear(); //添加电话 for (int i = 0; i < phones.length; i++) { values.put("raw_contact_id", contactId); values.put("data1", phones[i]); values.put(ContactsContract.RawContacts.Data.MIMETYPE, "vnd.android.cursor.item/phone_v2"); resolver.insert(uri, values); values.clear();

Spring multipartResolver上传文件进度条问题

Spring使用multipartResolver上传文件进度条![图片说明](https://img-ask.csdn.net/upload/201511/16/1447658363_879764.png)![图片说明](https://img-ask.csdn.net/upload/201511/16/1447658372_822531.png)![图片说明](https://img-ask.csdn.net/upload/201511/16/1447658381_817791.png)parseRequest(HttpServletRequest request)这个方法应该是每次上传都会进入的吧?为什么我的只是部署的时候进一次?而且我感觉配置文件配置的那个也没用,谁能告诉我,哪里错了吗?

android通讯录增删改查相关问题

自己写的一个手机通讯录的例子,lixtview来显示通讯录里面联系人的相关信息,长按 listview的每一项将会删除对应的联系人的信息,并且listview里面也会删除。为什么我的 代码只会删除listview里面的内容,通讯录的联系人信息不会删除,问题出在哪里啊? 下面是我的删除联系人的代码: public class deletContactListener implements OnLongClickListener{ @Override public boolean onLongClick(View v) { int i=(int)v.getTag(); TextView tv_name=(TextView) v.findViewById(R.id.contact_name); String name=tv_name.getText().toString(); ContentResolver resolver =getContentResolver(); Uri uri = Uri.parse("content://com.android.contacts/raw_contacts"); Cursor cursor = resolver.query(uri, new String[]{Data._ID},"display_name=?", new String[]{name}, null); if(cursor.moveToFirst()){ int id = cursor.getInt(0); //根据id删除data中的相应数据 resolver.delete(uri, "display_name=?", new String[]{name}); uri = Uri.parse("content://com.android.contacts/data"); resolver.delete(uri, "raw_contact_id=?", new String[]{id+""}); } //对于List<Map<String,String>>,删除list集合中的一个元素,只需要remove(i),i就是列号。 contacts_infos.remove(i);//删除当前视图上的i列元素,但没有删除数据库中元素。 lvadapter.notifyDataSetChanged(); return true;//只执行长按事件,return false,执行完长按事件后还要执行单击事件 } }

写了一个简单的springMVC项目,但是项目启动说找不到MultipartResolver

2014-12-18 17:29:34 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\jdk1.6.0_30\bin;C:\Users\Administrator\AppData\Local\MyEclipse Blue\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_11.0.0.me201211151802\tomcat\bin 2014-12-18 17:29:34 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2014-12-18 17:29:34 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 597 ms 2014-12-18 17:29:34 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2014-12-18 17:29:34 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.13 2014-12-18 17:29:35 org.apache.catalina.core.ApplicationContext log 信息: Marking servlet dispatcherServlet as unavailable 2014-12-18 17:29:35 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet /springMVC_01 threw load() exception java.lang.ClassNotFoundException: org.springframework.web.multipart.MultipartResolver at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2291) at java.lang.Class.getDeclaredFields(Class.java:1743) at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:131) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1108) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2014-12-18 17:29:35 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2014-12-18 17:29:35 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2014-12-18 17:29:35 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/25 config=null 2014-12-18 17:29:35 org.apache.catalina.startup.Catalina start 信息: Server startup in 903 ms

springcloud有类似dubbo的dubbo-resolver.properies的直连机制吗?

以前使用dubbo时,开发联调时,依赖别人的服务,可以在dubbo-resolver.properies指定服务的目标地址。springcloud有类似的机制吗

获取手机通讯录联系人中出现了问题

Cursor cursor = resolver.query(Phone.CONTENT_URI, new String[]{Phone.CONTACT_ID}, null, null, null); 中的cursor在vivo,oppo手机中可能为空这是为什么?我要上传通讯录,怎么解决啊?

Openresty连接本地数据库出现的问题

本人是程序员刚转运维这边,所以有很多不是很了解,刚刚搭建了一个Openresty的 环境,然后根据网上的教程开始最基本的数据库查询,在连接本地的mysql的时候出了 问题,命令行curl localhost:8003,最开始问题是: Access denied for user 'echemi'@'127.0.0.1' (using password: YES) 后来调查应该是在连接数据库指定host的时候应该用localhost而不是127.0.0.1, 改成host = "localhost",执行curl localhost:8003问题是: no resolver defined to resolve "localhost" 后来在http中加上resolver 8.8.8.8;,执行命令行后,问题是 localhost could not be resolved 有大神知道是什么原因吗

关于android获取手机联系人信息的问题,求大神帮帮忙?谢谢。

下面是我写的代码,最后真机运行布局上只出现了一条数据。 1、实体类 public class ContactsBean { private int contactId; private int icon; private String contactsName; private String company; private String phoneNumber; private String remark; private String job; private String email; public String getJob() { return job; } public void setJob(String job) { this.job = job; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getContactId() { return contactId; } public void setContactId(int contactId) { this.contactId = contactId; } public int getIcon() { return icon; } public void setIcon(int icon) { this.icon = icon; } public String getContactsName() { return contactsName; } public void setContactsName(String contactsName) { this.contactsName = contactsName; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } 2 2、主代码 package com.kag.activity; import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ListView; import com.addresslist.R; import java.security.Provider; import java.util.ArrayList; import java.util.List; import FragmentAdapter.AddContactFromAddressAdapter; import bean.ContactsBean; public class AddContactFromAddressList extends AppCompatActivity { ContactsBean contactsBean; private ListView lv; ArrayList contacts; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_contact_from_address_list); lv=findViewById(R.id.lv_contacts_list); contactsBean=new ContactsBean(); contacts=new ArrayList(); reaContacts(contacts); AddContactFromAddressAdapter adapter=new AddContactFromAddressAdapter(this,contacts); lv.setAdapter(adapter); } //从手机通讯录中读取数据 public void reaContacts(ArrayList contacts){ Uri uri=Uri.parse("content://com.android.contacts/contacts"); ContentResolver resolver=this.getContentResolver(); Cursor cursor=resolver.query(uri,null,null,null,ContactsContract.Contacts.SORT_KEY_PRIMARY); while (cursor.moveToNext()) { int id = cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts._ID)); String name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); String sort_key = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.SORT_KEY_PRIMARY)); contactsBean.setContactsName(name); contactsBean.setContactId(id); Cursor phone = resolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID+"="+id, null, null); ArrayList phoneNumber=new ArrayList(); while (phone.moveToNext()) { String number = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); phoneNumber.add(number); System.out.println(name+":"+number); } contactsBean.setPhoneNumber(String.valueOf(phoneNumber)); contacts.add(contactsBean); System.out.println(contactsBean.getContactsName()+":"+contactsBean.getPhoneNumber()); } } } 3、适配器 public class AddContactFromAddressAdapter extends BaseAdapter { private List<ContactsBean> contacts; LayoutInflater inflater; public AddContactFromAddressAdapter(Context context,List<ContactsBean> contacts){ this.contacts=contacts; inflater=LayoutInflater.from(context); } @Override public int getCount() { return contacts.size(); } @Override public Object getItem(int position) { return contacts.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder=null; if (convertView==null){ convertView=inflater.inflate(R.layout.contacts_cell,null); holder=new ViewHolder(); holder.sort_key=convertView.findViewById(R.id.tv_sort_key); holder.mPhones=convertView.findViewById(R.id.tv_phones); convertView.setTag(holder); }else { holder= (ViewHolder) convertView.getTag(); } holder.sort_key.setText(contacts.get(position).getContactsName()); holder.mPhones.setText(contacts.get(position).getPhoneNumber()); return convertView; } private final class ViewHolder{ public TextView sort_key; public TextView mPhones; } } 4运行结果 ![图片说明](https://img-ask.csdn.net/upload/201801/11/1515667064_810395.jpg)

从联系人中提取email异常

从一个联系人信息中提取Email 我用了下面的代码: Cursor c1; c1 = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, ContactsContract.Contacts.DISPLAY_NAME); if(c1==null) return; if(c1.getCount() > 0) { while(c1.moveToNext()) { String id = c1.getString(c1.getColumnIndex(Contacts._ID)); if(id==null) continue; Cursor email_crsr = getContentResolver().query(CommonDataKinds.Email.CONTENT_URI, null, CommonDataKinds.Phone.CONTACT_ID +" = ?", new String[]{id}, null); if(email_crsr!=null) email = phone_crsr.getString(phone_crsr.getColumnIndex(CommonDataKinds.Email.DATA)); } } 然后报出如下异常: ```04-09 10:38:59.487: E/AndroidRuntime(8150): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 4```

Composer将依赖项更新为旧版本

<div class="post-text" itemprop="text"> <p>I regularly run <code>composer update</code> in my project and then check what dependencies were updated. But today I noticed a strange output:</p> <pre><code>Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 2 updates, 0 removals - Updating phpdocumentor/type-resolver (0.4.0 =&gt; 0.3.0): Downloading (100%) - Updating phpdocumentor/reflection-docblock (3.2.0 =&gt; 3.2.1): Downloading (100%) Writing lock file </code></pre> <p>You can see that the phpdocumentor/type-resolver package was downgraded from 0.4.0 to 0.3.0, though the command was <code>update</code>. Is it normal or a bug or whatever?</p> </div>

java.io.FileNotFoundException: NUL: (系统找不到指定的文件。)

``` ![图片说明](https://img-ask.csdn.net/upload/201903/05/1551776620_308084.png)![图片说明](https://img-ask.csdn.net/upload/201903/05/1551776635_236944.png)![图片说明](https://img-ask.csdn.net/upload/201903/05/1551776645_134785.png) ```spring-boot-starter-undertow 其他电脑都没问题。就我自己笔记本不行,用内嵌的tomcat是可以的 org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.io.IOError: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) [undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-1.4.23.Final.jar:1.4.23.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161] Caused by: java.io.IOError: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at org.xnio.channels.Channels$4.run(Channels.java:998) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at org.xnio.channels.Channels$4.run(Channels.java:988) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161] at org.xnio.channels.Channels.<clinit>(Channels.java:988) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.flushInternal(ServletOutputStreamImpl.java:493) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:475) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297) ~[na:1.8.0_161] at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141) ~[na:1.8.0_161] at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) ~[na:1.8.0_161] at org.springframework.util.StreamUtils.copy(StreamUtils.java:119) ~[spring-core-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:106) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.StringHttpMessageConverter.writeInternal(StringHttpMessageConverter.java:41) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:226) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:247) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] ... 52 common frames omitted Caused by: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at java.io.FileOutputStream.open0(Native Method) ~[na:1.8.0_161] at java.io.FileOutputStream.open(FileOutputStream.java:270) ~[na:1.8.0_161] at java.io.FileOutputStream.<init>(FileOutputStream.java:213) ~[na:1.8.0_161] at java.io.FileOutputStream.<init>(FileOutputStream.java:101) ~[na:1.8.0_161] at org.xnio.channels.Channels$4.run(Channels.java:993) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] ... 72 common frames omitted 2019-03-05 17:04:58.620 ERROR 2260 --- [ XNIO-2 task-1] io.undertow.request : UT005071: Undertow request failed HttpServerExchange{ GET /A request {Connection=[keep-alive], Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8], Accept-Language=[zh-CN,zh;q=0.8], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate, br], User-Agent=[Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36], Upgrade-Insecure-Requests=[1], Host=[localhost:6001]} response {Connection=[keep-alive], Content-Type=[text/html;charset=UTF-8], Content-Length=[1], Date=[Tue, 05 Mar 2019 09:04:58 GMT]}} java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:615) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:479) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:568) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:339) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_161] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_161] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_161] 2019-03-05 17:04:58.729 ERROR 2260 --- [ XNIO-2 task-2] io.undertow.request : UT005023: Exception handling request to /favicon.ico org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.io.IOError: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) [undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-1.4.23.Final.jar:1.4.23.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161] Caused by: java.io.IOError: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at org.xnio.conduits.Conduits$1.run(Conduits.java:237) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at org.xnio.conduits.Conduits$1.run(Conduits.java:227) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_161] at org.xnio.conduits.Conduits.<clinit>(Conduits.java:227) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.writeFinal(AbstractFixedLengthStreamSinkConduit.java:175) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:2073) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:571) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:606) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.updateWritten(ServletOutputStreamImpl.java:370) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at io.undertow.servlet.spec.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:152) ~[undertow-servlet-1.4.23.Final.jar:1.4.23.Final] at org.springframework.util.StreamUtils.copy(StreamUtils.java:138) ~[spring-core-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.ResourceHttpMessageConverter.writeContent(ResourceHttpMessageConverter.java:110) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:102) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:45) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:226) ~[spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:480) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.16.RELEASE.jar:4.3.16.RELEASE] ... 52 common frames omitted Caused by: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。) at java.io.FileOutputStream.open0(Native Method) ~[na:1.8.0_161] at java.io.FileOutputStream.open(FileOutputStream.java:270) ~[na:1.8.0_161] at java.io.FileOutputStream.<init>(FileOutputStream.java:213) ~[na:1.8.0_161] at java.io.FileOutputStream.<init>(FileOutputStream.java:101) ~[na:1.8.0_161] at org.xnio.conduits.Conduits$1.run(Conduits.java:232) ~[xnio-api-3.3.8.Final.jar:3.3.8.Final] ... 71 common frames omitted

为什么golang Lookup ***函数无法提供服务器参数?

<div class="post-text" itemprop="text"> <p>For <code>nslookup</code> command, it has <code>nslookup somewhere.com some.dns.server</code>. </p> <p>However, it seems that golang dnsclient only load config from <code>/etc/resolv.conf</code></p> <p>code here: <a href="https://golang.org/src/net/dnsclient_unix.go#L225" rel="noreferrer">https://golang.org/src/net/dnsclient_unix.go#L225</a></p> <p>Does the golang standard library provide something like <code>func LookupTXT(name string, dnsServer string) (txt []string, err error)</code> ?</p> <p><code>requirement</code>: 1. Don't change the default <code>/etc/resolv.conf</code>.</p> </div>

SpringBoot不能批量加载mapperLocations!急!在线等!求大神指点啊!

@Configuration public class MyBatisConfig { @Autowired private BasicDataSource basicDataSource; @Bean @ConditionalOnMissingBean //当容器里没有指定的Bean的情况下创建该对象 public SqlSessionFactoryBean sqlSessionFactory() throws IOException { SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); // 设置数据源 sqlSessionFactoryBean.setDataSource(basicDataSource); // 设置mybatis的主配置文件 ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); Resource mybatisConfigXml = resolver.getResource("classpath:mybatis/SqlMapConfig.xml"); sqlSessionFactoryBean.setConfigLocation(mybatisConfigXml); // 设置别名包 sqlSessionFactoryBean.setTypeAliasesPackage("com.zeunpro.robot.approbot.pojo"); //就是这句代码,只能指定单个mapper.xml文件,加通配符的话找不到文件 sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:mappers/AdminUserMapper.xml")); return sqlSessionFactoryBean; } } ``` ```

请大神帮我看看这是什么问题,要疯了

2017-05-31 10:26:20,340 ERROR (ExpressionCompiler.java:128) org.apache.commons.jexl2.JexlException: com.bstek.dorado.core.el.ExpressionCompiler.nextMiddleExpression@111 parsing failed org.apache.commons.jexl2.JexlException: com.bstek.dorado.core.el.ExpressionCompiler.nextMiddleExpression@111 parsing failed at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:814) at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:384) at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:368) at com.bstek.dorado.core.el.ExpressionCompiler.nextMiddleExpression(ExpressionCompiler.java:111) at com.bstek.dorado.core.el.ExpressionCompiler.middleCompile(ExpressionCompiler.java:63) at com.bstek.dorado.core.el.ExpressionCompiler.compileSections(ExpressionCompiler.java:45) at com.bstek.dorado.core.el.DefaultExpressionHandler.compile(DefaultExpressionHandler.java:69) at com.bstek.dorado.data.config.xml.MapValuesParser.doParse(MapValuesParser.java:40) at com.bstek.dorado.config.xml.DispatchableXmlParser.parse(DispatchableXmlParser.java:145) at com.bstek.dorado.config.xml.DispatchableXmlParser.parseProperty(DispatchableXmlParser.java:368) at com.bstek.dorado.config.xml.CompositePropertyParser.parseSubProperties(CompositePropertyParser.java:88) at com.bstek.dorado.config.xml.CompositePropertyParser.doParse(CompositePropertyParser.java:115) at com.bstek.dorado.config.xml.DispatchableXmlParser.parse(DispatchableXmlParser.java:145) at com.bstek.dorado.config.xml.DispatchableXmlParser.parseProperty(DispatchableXmlParser.java:368) at com.bstek.dorado.config.xml.DispatchableXmlParser.parseProperties(DispatchableXmlParser.java:341) at com.bstek.dorado.config.xml.ObjectParser.initDefinition(ObjectParser.java:198) at com.bstek.dorado.data.config.xml.GenericObjectParser.initDefinition(GenericObjectParser.java:70) at com.bstek.dorado.data.config.xml.PropertyDefParser.initDefinition(PropertyDefParser.java:60) at com.bstek.dorado.config.xml.ObjectParser.internalParse(ObjectParser.java:218) at com.bstek.dorado.data.config.xml.GenericObjectParser.doParse(GenericObjectParser.java:59) at com.bstek.dorado.data.config.xml.PropertyDefParser.doParse(PropertyDefParser.java:65) at com.bstek.dorado.config.xml.DispatchableXmlParser.parse(DispatchableXmlParser.java:145) at com.bstek.dorado.config.xml.DispatchableXmlParser.dispatchElement(DispatchableXmlParser.java:259) at com.bstek.dorado.config.xml.DispatchableXmlParser.dispatchChildElements(DispatchableXmlParser.java:178) at com.bstek.dorado.config.xml.ObjectParser.initDefinition(ObjectParser.java:201) at com.bstek.dorado.data.config.xml.GenericObjectParser.initDefinition(GenericObjectParser.java:70) at com.bstek.dorado.data.config.xml.DataTypeParser.initDefinition(DataTypeParser.java:75) at com.bstek.dorado.config.xml.ObjectParser.internalParse(ObjectParser.java:218) at com.bstek.dorado.data.config.xml.DataTypeParser.internalParse(DataTypeParser.java:142) at com.bstek.dorado.data.config.xml.GenericObjectParser.doParse(GenericObjectParser.java:59) at com.bstek.dorado.config.xml.DispatchableXmlParser.parse(DispatchableXmlParser.java:145) at com.bstek.dorado.data.config.xml.DataObjectParserDispatcher.parse(DataObjectParserDispatcher.java:51) at com.bstek.dorado.view.config.xml.ModelParser.parse(ModelParser.java:40) at com.bstek.dorado.config.xml.DispatchableXmlParser.dispatchElement(DispatchableXmlParser.java:259) at com.bstek.dorado.view.config.xml.ViewConfigParser.doParse(ViewConfigParser.java:100) at com.bstek.dorado.config.xml.DispatchableXmlParser.parse(DispatchableXmlParser.java:145) at com.bstek.dorado.view.config.XmlViewConfigDefinitionFactory.create(XmlViewConfigDefinitionFactory.java:305) at com.bstek.dorado.view.config.CacheableXmlViewConfigDefinitionFactory.create(CacheableXmlViewConfigDefinitionFactory.java:79) at com.bstek.dorado.view.manager.ViewConfigManagerSupport.getViewConfig(ViewConfigManagerSupport.java:97) at com.bstek.dorado.view.service.DataServiceProcessorSupport.getViewConfig(DataServiceProcessorSupport.java:202) at com.bstek.dorado.view.service.DataServiceProcessorSupport.getDataType(DataServiceProcessorSupport.java:218) at com.bstek.dorado.view.service.LoadDataServiceProcessor.doExecute(LoadDataServiceProcessor.java:241) at com.bstek.dorado.view.service.DataServiceProcessorSupport.execute(DataServiceProcessorSupport.java:128) at com.bstek.dorado.view.resolver.ViewServiceInvoker.invoke(ViewServiceInvoker.java:30) at com.bstek.dorado.view.resolver.ViewServiceInvoker_$$_javassist_19._d5invoke(ViewServiceInvoker_$$_javassist_19.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.bstek.dorado.util.proxy.MethodInterceptorDispatcher$FinalJavassistMethodInterceptor.invoke(MethodInterceptorDispatcher.java:96) at com.bstek.dorado.util.proxy.ChainedMethodInvocation.proceed(ChainedMethodInvocation.java:73) at com.bstek.dorado.util.proxy.MethodInterceptorDispatcher$FinalAopallianceMethodInterceptor.invoke(MethodInterceptorDispatcher.java:67) at com.bstek.dorado.util.proxy.ChainedMethodInvocation.proceed(ChainedMethodInvocation.java:73) at com.bstek.dorado.console.security.ViewServiceSecurityInterceptor.invoke(ViewServiceSecurityInterceptor.java:82) at com.bstek.dorado.util.proxy.ChainedMethodInvocation.proceed(ChainedMethodInvocation.java:73) at com.bstek.dorado.console.performance.interceptor.RemoteServiceMethodInterceptor.invoke(RemoteServiceMethodInterceptor.java:119) at com.bstek.dorado.util.proxy.MethodInterceptorDispatcher.invoke(MethodInterceptorDispatcher.java:170) at com.bstek.dorado.util.proxy.MethodInterceptorDispatcher.invoke(MethodInterceptorDispatcher.java:241) at com.bstek.dorado.view.resolver.ViewServiceInvoker_$$_javassist_19.invoke(ViewServiceInvoker_$$_javassist_19.java) at com.bstek.dorado.view.resolver.ViewServiceResolver.processTask(ViewServiceResolver.java:152) at com.bstek.dorado.view.resolver.ViewServiceResolver.execute(ViewServiceResolver.java:232) at com.bstek.dorado.web.resolver.AbstractTextualResolver.doHandleRequest(AbstractTextualResolver.java:128) at com.bstek.dorado.web.resolver.WebContextSupportedController.handleRequestInternal(WebContextSupportedController.java:68) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.bstek.dorado.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:100) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

在Swagger / Zircote / Nelmio-api-doc中使用外部定义

<div class="post-text" itemprop="text"> <p>I use following versions:</p> <pre><code>zircote/swagger-php in version 2.0.10 nelmio/api-doc-bundle in version v3.0.0-BETA4 </code></pre> <p>My Controller with one Action</p> <pre><code> /** * @Operation( * tags={"DeliverySlip"}, * summary="Send information after deliveryItems are processed and deliverySlip was scanned", * @SWG\Response( * response="200", * description="Returned when successful" * ), * @SWG\Response( * response="400", * description="Returned on a missing request parameter" * ), * @SWG\Response( * response="500", * description="Returned on any other error" * ), * @SWG\Parameter( * name="slipIdentifier", * description="identifier of delivery slip", * type="string", * format="string", * in="path" * ), * @SWG\Parameter( * name="JSON update body", * in="body", * description="json login request object", * required=true, * @SWG\Schema(ref="#/definitions/product") * ) * ) * * @Put("/deliveryslip/update/{slipIdentifier}", requirements={"slipIdentifier" = "\w+"}) * * @param string $slipIdentifier * @param Request $request * @return JsonResponse */ public function updateDeliverySlipAction($slipIdentifier, Request $request) </code></pre> <p>This is the Model/Definition I want to use in my Controller-Action:</p> <pre><code>&lt;?php namespace Sendis\Presentation\RestBundle\Model; use Swagger\Annotations as SWG; /** * @SWG\Definition( * definition="product", * type="object", * required={"name"} * ) */ class Product { /** * @SWG\Property(example="doggie") * @var string */ public $name; } </code></pre> <p>But when I go to my documentation page at /api/doc, I see this error:</p> <pre><code>Errors Resolver error at paths./api/deliveryslip/update/{slipIdentifier}.put.parameters.1.schema.$ref Could not resolve reference: #/definitions/product </code></pre> <p>The next thing I recognised: My <strong>product.php</strong> does not seem to be read by <code>swagger</code> at all. I can write whatever I want here. No errors, even if I misspell something. This brings me to the conclusion, that my <strong>product.php</strong> was not found by <code>swagger</code> at all.</p> <p>I am helpful for every hint.</p> <p>Kind regards, Max</p> </div>

Symfony2:实体的FormBuilder - optionsResolver

<div class="post-text" itemprop="text"> <p>I've got 3 entities: Project,User,Module</p> <p>Module entity got fields:</p> <ol> <li>$id</li> <li>$user - Many to One with User entity </li> <li>$project - Many to One with Project entity</li> <li>$modules - ArrayCollection</li> </ol> <p>ModuleController:</p> <pre><code> $form = $this-&gt;createForm(new ModuleType($em), $module, array('user' =&gt; $userData, 'project' =&gt; $projectData)); </code></pre> <p>ModuleType is the problem. I want to build form collection only for specific user (userId) specific project (projectId) with $modules fields. </p> <p>How should I set setDefaultsOptions to correctly use class Module (to build form) with options user and project? </p> <p>@Edit Ok it's almost what I want:</p> <pre><code>public function buildForm(FormBuilderInterface $builder, array $options) { $transformer = new ModuleToArrayTransformer($this-&gt;entityManager); $builder-&gt;add('modules', 'choice', array( 'multiple' =&gt; true, 'expanded' =&gt; true, 'choices' =&gt; array(array_keys($options['data'][0]-&gt;getModules())) )) -&gt;addViewTransformer($transformer); } public function setObject($object) { $this-&gt;object = $object; } /** * @param OptionsResolverInterface $resolver */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver-&gt;setDefaults(array( 'data_class' =&gt; 'DevDash\ProjectBundle\Entity\Module', 'project' =&gt; 'DevDash\ProjectBundle\Entity\Project', 'user' =&gt; 'DevDash\ProjectBundle\User', )); } </code></pre> <p>It makes correct form but all boxes are unchecked. Any idea why? </p> </div>

SpringBeanFacesELResolver的疑问,不定义任何bean竟然也不报错。

我试图使用Spring来管理JSF的Managed Bean,在faces-context中配置了SpringBeanFacesELResolver <br /><pre name="code" class="xml"> &lt;application&gt; &lt;el-resolver&gt;org.springframework.web.jsf.el.SpringBeanFacesELResolver&lt;/el-resolver&gt; &lt;/application&gt; </pre> <br />但是,发现一个问题,比如我在jsf中用了这样一个EL表达式 <br /><pre name="code" class="xml">&lt;h:outputtext value="#{TestBean.text}"&gt;<br /> </pre> <br />但是,如果Spring中没有定义TestBean,managed-bean中也没有定义TestBean,页面竟然也不报错。 <br />请教一下,是何原因。 <br /> <br />

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

JVM内存结构和Java内存模型都是面试的热点问题,名字看感觉都差不多,网上有些博客也都把这两个概念混着用,实际上他们之间差别还是挺大的。 通俗点说,JVM内存结构是与JVM的内部存储结构相关,而Java内存模型是与多线程编程相关,本文针对这两个总是被混用的概念展开讲解。 JVM内存结构 JVM构成 说到JVM内存结构,就不会只是说内存结构的5个分区,而是会延展到整个JVM相关的问题,所以先了解下

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

立即提问
相关内容推荐