首页 \ 问答 \ 服务发现失败[Ljava.lang.StackTraceElement(Service discovery failed[Ljava.lang.StackTraceElement)

服务发现失败[Ljava.lang.StackTraceElement(Service discovery failed[Ljava.lang.StackTraceElement)

我刚刚用Android和蓝牙开发我的应用程序,你可以发送消息共享文件和蓝牙聊天。 这是一个非常奇怪的应用程序,每次它显示错误和其他时间它完美的工作。 这是我的问题的首要问题

E / BluetoothEventLoop.cpp(298):onCreateDeviceResult:D-Bus错误:org.bluez.Error.AlreadyExists(已经存在)`

第二个错误:

服务发现失败[Ljava.lang.StackTraceElement

我的代码:

    private BluetoothSocket getLaSocketConnecte(BluetoothDevice myBtServer, UUID uuidToTry)           
    { 
      BluetoothSocket myBSock; 
      try 
      { 
        if (BtAdapter.isDiscovering()) 
        { 
          BtAdapter.cancelDiscovery(); 
        } 
        myBSock = myBtServer.createRfcommSocketToServiceRecord(uuidToTry);
        myBSock.connect(); 
        return myBSock; 
      } catch (Exception e) { 
        Log.i(TAG,"IOException . Msg d'erreur :" + e.getMessage()+ e.getStackTrace()); 
      } 
      return null; 
    }

这是日志:

04-01 20:38:28.079: I/Connexion(9240): Msg d'erreur : Msg d erreur 

:Service discovery failed
04-01 20:38:28.079: I/Connexion(9240): java.io.IOException: Service discovery failed
04-01 20:38:28.079: I/Connexion(9240):  at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:403)
04-01 20:38:28.079: I/Connexion(9240):  at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:213)
            myBSock.connect();
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.getLaSocketConnecte(Connexion.java:190)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.connecterA(Connexion.java:149)
            btSock = getLaSocketConnecte(btDevice, uuidList.get(i));
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.ConnecterTousLesAppreils(Connexion.java:293)
            connecterA(device.getKey());
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.EnvoyeBroadcastMsg(Connexion.java:428)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.broadcastMessage(Connexion.java:205)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.BtPaquetReceiver.onReceive(BtPaquetReceiver.java:28)

能帮我解决一下这个问题吗?

谢谢 :)



I just finished developing my Application with Android and bluetooth you can send message share files and chat with bluetooth. It's a very strange application every time it shows an error and other time it works perfectly. Here is the top of my problems

E/BluetoothEventLoop.cpp(298): onCreateDeviceResult: D-Bus error: org.bluez.Error.AlreadyExists (Already Exists)`

the second error :

Service discovery failed[Ljava.lang.StackTraceElement

my code :

    private BluetoothSocket getLaSocketConnecte(BluetoothDevice myBtServer, UUID uuidToTry)           
    { 
      BluetoothSocket myBSock; 
      try 
      { 
        if (BtAdapter.isDiscovering()) 
        { 
          BtAdapter.cancelDiscovery(); 
        } 
        myBSock = myBtServer.createRfcommSocketToServiceRecord(uuidToTry);
        myBSock.connect(); 
        return myBSock; 
      } catch (Exception e) { 
        Log.i(TAG,"IOException . Msg d'erreur :" + e.getMessage()+ e.getStackTrace()); 
      } 
      return null; 
    }

And here is the log :

04-01 20:38:28.079: I/Connexion(9240): Msg d'erreur : Msg d erreur 

:Service discovery failed
04-01 20:38:28.079: I/Connexion(9240): java.io.IOException: Service discovery failed
04-01 20:38:28.079: I/Connexion(9240):  at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:403)
04-01 20:38:28.079: I/Connexion(9240):  at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:213)
            myBSock.connect();
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.getLaSocketConnecte(Connexion.java:190)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.connecterA(Connexion.java:149)
            btSock = getLaSocketConnecte(btDevice, uuidList.get(i));
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.ConnecterTousLesAppreils(Connexion.java:293)
            connecterA(device.getKey());
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.EnvoyeBroadcastMsg(Connexion.java:428)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.Connexion.broadcastMessage(Connexion.java:205)
04-01 20:38:28.079: I/Connexion(9240):  at com.Android.Bt.BtPaquetReceiver.onReceive(BtPaquetReceiver.java:28)

Can you please help me to figure out the solution?

Thanks :)



原文:https://stackoverflow.com/questions/15749372
更新时间:2023-06-11 08:06

最满意答案

服务器坏了。 它现在应该工作。


The server was down. It should work now.

相关问答

更多
  • 这可能不是每次都有问题。 您的.htaccess代码可能没问题。 请检查godaddy服务器上的根文件夹的权限。 它取决于您使用的服务器类型。 请在服务器上启用您的文件夹权限。 那么它可能适合你。 It may not be a problem everytime. Your .htaccess code may be alright. Please check permission of your root folder on godaddy server. It dependent on which t ...
  • 首先, 您需要启用并查看您的Web消息的详细错误 ,因为这是一般的消息,没有提供有关出于安全原因发生的情况的信息。 有了详细的错误,您可以在这里找到真正的问题。 此外,如果您可以在服务器上运行浏览器 ,则可以获取有关错误的详细信息,因为服务器会认识到您是本地的,并显示给您。 或者如果您可以使用事件查看器读取服务器的日志 ,还可以看到错误的详细信息。 在IIS 6上 ...
  • 如果您没有将customErrors属性设置为任何值或设置为On ASP.Net将显示500。 将此添加到web.config中以查看实际错误是什么: 一旦你知道实际的错误是什么,你可以继续修复它。 ASP.Net will display a 500 if you don't have the customErrors property set to anything or it is set to On. Add this to the web. ...
  • 服务器坏了。 它现在应该工作。 The server was down. It should work now.
  • 您的加入查询不正确。 $this->db->select('bikes.store_id')->from('mappings')->join('bikes', 'bikes.product_id = mappings.product_id')->where('mappings.product_id', $prod_id)->get()->result(); 试试这个查询。 在控制器中写下以查看正在生成的查询。 $this->output->enable_profiler(TRUE); Your join ...
  • HTTP 500错误没有意义。 它只是告诉你出了什么问题,尽管你可以看到无论是什么原因都是空指针错误。 您需要查看服务器日志以查看导致空指针错误的原因。 这个StackOverflow问题有关如何通过文件系统或NetBeans手动查找服务器日志的一些很好的答案。 GlassFish服务器日志的位置 An HTTP 500 error is meaningless. It is only telling you that something went wrong, although you can see t ...
  • 它适用于我 - 检查你是否启用了mod_rewrite就像@Panama Jack建议的那样。 a2query -m rewrite 如果没有说启用,则启用它: a2enmod rewrite service apache2 restart 你也可能想要删除规则中的第一个斜杠,如果你的基数是/ ,那么它变成: RewriteRule ^(.*)/(.*)/(.*)$ index.php?pageLevel1=$1&pageLevel2=$2&pageLevel3=$3 [L,R=301] It ...
  • 这不是客户端问题,而是服务器问题。 有关详细信息,请查看此信息: http : //www.checkupdown.com/status/E500.html 此错误只能通过修复Web服务器软件来解决。 这不是客户端问题。 由Web服务器站点的操作员来定位和分析日志,这些日志应提供有关错误的更多信息。 This is not a client-side problem, but a server problem. Check this for more info: http://www.checkupdown ...
  • 看起来IIS正在隐藏您的错误。 在IIS中的'错误页面'下,选择500错误并点击'编辑功能设置'并选择'详细错误' - 现在您应该看到完整的错误信息(提供的调试是在n CF上)。 Looks like IIS is hiding the errors from you. Under 'Error Pages' in IIS, select the 500 error and click 'Edit feature settings' and select 'Detailed errors' - you sh ...
  • 在cpanel中,文件权限应为0644 ,文件夹权限应为0755 。 您收到错误是因为index.php权限是0755 。 要设置正确的权限,您需要使用以下命令: chown www-data:www-data -R * # Let apache be owner find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x find . -type f -exec chmod 644 {} \ ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。