+ Responder ao Tópico



  1. #1
    rafaelgimenes
    Galera, blz! estou com um problemas interessante.

    Sei que o problema é Java! mas tem haver com direitos.
    Como root funciona, como usuário não funciona, e minha aplicação irá rodar como usuário.

    Segue um resumo do problema.


    Estou usando uma biblioteca para se comunicar com a porta paralela
    /dev/lp0
    Só que na verdade o código faz referência diretamente ao endereço da porta 0x378.
    O nome da biblioteca que uso no java é o LibParPort.
    Como disse ela faz referência diretamente ao endereço 0x378, então acredito que eu tenha que dar direitos no nesse endereço, estou ficando meio louco já pessoal me ajude!


    Espero ajuda por favor, é inviável usar o sudo pois essa aplicação faz outras coisas que comprometem a segurança.


    Segue o código que funciona como root.
    Código :
    public void RecebeValorParalela ()
      {
         ParallelPort lpt1 = new ParallelPort(0x378);
         int aByte;
         aByte = lpt1.read(); // read a byte from the port's STATUS pins
         System.out.println("Leu Paralela: " + aByte);
     
     
      } // Fim do método RecebeValorParalela

    Segue o erro que dá quando executo o código com o usuário normal.

    Código :
    ioperm error: Operation not permitted
     
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0xB79618FB
    Function=(null)
    Library=/usr/java/j2sdk1.4.2_04/jre/lib/i386/libparport.so
     
    NOTE: We are unable to locate the function name symbol for the error
       just occurred. Please refer to release documentation for possible
       reason and solutions.
     
     
    Current Java thread:
      at parport.ParallelPort.readOneByte(Native Method)
      at parport.ParallelPort.read(ParallelPort.java:19)
      at Oxilab.RecebeValorParalela(Oxilab.java:2314)
      at Oxilab$6.mouseClicked(Oxilab.java:578)
      at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
      at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:211)
      at java.awt.Component.processMouseEvent(Component.java:5103)
      at java.awt.Component.processEvent(Component.java:4897)
      at java.awt.Container.processEvent(Container.java:1569)
      at java.awt.Component.dispatchEventImpl(Component.java:3615)
      at java.awt.Container.dispatchEventImpl(Container.java:1627)
      at java.awt.Component.dispatchEvent(Component.java:3477)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
      at java.awt.Container.dispatchEventImpl(Container.java:1613)
      at java.awt.Component.dispatchEvent(Component.java:3477)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
     
    Dynamic libraries:
    08048000-0804e000 r-xp 00000000 03:07 121943   /usr/java/j2sdk1.4.2_04/bin/java
    0804e000-0804f000 rwxp 00005000 03:07 121943   /usr/java/j2sdk1.4.2_04/bin/java
    0804f000-08322000 rwxp 0804f000 00:00 0     [heap]
    aa8c1000-aa8dc000 r-xp 00000000 03:07 123088   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libdcpr.so
    aa8dc000-aa8ef000 rwxp 0001a000 03:07 123088   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libdcpr.so
    aa970000-aa9a7000 r-xp 00000000 03:07 123099   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libjpeg.so
    aa9a7000-aa9a8000 rwxp 00036000 03:07 123099   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libjpeg.so
    aac2d000-aac2f000 r-xp 00000000 03:07 687    /usr/lib/gconv/ISO8859-15.so
    aac2f000-aac31000 rwxp 00001000 03:07 687    /usr/lib/gconv/ISO8859-15.so
    aac31000-aac37000 r-xs 00000000 03:07 773    /usr/lib/gconv/gconv-modules.cache
    aac57000-aac75000 r-xp 00000000 03:07 26715   /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
    aac75000-aac77000 rwxp 0001e000 03:07 26715   /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
    aac77000-aac7f000 r-xp 00000000 03:07 26782   /usr/X11R6/lib/libXrender.so.1.2.2
    aac7f000-aac80000 rwxp 00007000 03:07 26782   /usr/X11R6/lib/libXrender.so.1.2.2
    aac80000-aac89000 r-xp 00000000 03:07 26752   /usr/X11R6/lib/libXcursor.so.1.0.2
    aac89000-aac8a000 rwxp 00008000 03:07 26752   /usr/X11R6/lib/libXcursor.so.1.0.2
    aac94000-aac9f000 rwxs 00000000 00:07 1146887  /SYSV00000000 (deleted)
    aac9f000-aaca1000 r-xp 00000000 03:07 26716   /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
    aaca1000-aaca2000 rwxp 00001000 03:07 26716   /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2
    aaca2000-aad5c000 r-xp 00000000 03:07 123090   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libfontmanager.so
    aad5c000-aad76000 rwxp 000b9000 03:07 123090   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libfontmanager.so
    aad77000-aadde000 r-xs 00000000 03:07 123749   /home/softwares/eclipse/workspace/oxilabIII/mysql-connector-java-3.1.10-bin.jar
    aadde000-aadf5000 r-xp 00000000 03:07 26730   /usr/X11R6/lib/libICE.so.6.4
    aadf5000-aadf6000 rwxp 00016000 03:07 26730   /usr/X11R6/lib/libICE.so.6.4
    aadf8000-aae00000 r-xp 00000000 03:07 26734   /usr/X11R6/lib/libSM.so.6.0
    aae00000-aae01000 rwxp 00008000 03:07 26734   /usr/X11R6/lib/libSM.so.6.0
    aae01000-aaed7000 r-xp 00000000 03:07 26736   /usr/X11R6/lib/libX11.so.6.2
    aaed7000-aaedb000 rwxp 000d6000 03:07 26736   /usr/X11R6/lib/libX11.so.6.2
    aaedb000-aaeea000 r-xp 00000000 03:07 26760   /usr/X11R6/lib/libXext.so.6.4
    aaeea000-aaeeb000 rwxp 0000e000 03:07 26760   /usr/X11R6/lib/libXext.so.6.4
    aaeeb000-aaf3f000 r-xp 00000000 03:07 26786   /usr/X11R6/lib/libXt.so.6.0
    aaf3f000-aaf42000 rwxp 00054000 03:07 26786   /usr/X11R6/lib/libXt.so.6.0
    aaf43000-aaf96000 r-xp 00000000 03:07 123103   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libmlib_image.so
    aaf96000-aaf97000 rwxp 00052000 03:07 123103   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libmlib_image.so
    aaf97000-ab262000 r-xp 00000000 03:07 123086   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libawt.so
    ab262000-ab278000 rwxp 002ca000 03:07 123086   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libawt.so
    ab4a1000-ab4cd000 r-xp 00000000 03:07 26288   /usr/share/locale/ISO-8859-15/LC_CTYPE
    b577b000-b5837000 r-xs 00000000 03:07 123027   /usr/java/j2sdk1.4.2_04/jre/lib/ext/localedata.jar
    b5837000-b583d000 r-xs 00000000 03:07 123752   /usr/java/j2sdk1.4.2_04/jre/lib/ext/jcl.jar
    b583d000-b5877000 r-xs 00000000 03:07 123760   /usr/java/j2sdk1.4.2_04/jre/lib/ext/mysql-connector-java-3.0.16-ga-bin.jar
    b5877000-b5884000 r-xs 00000000 03:07 123037   /usr/java/j2sdk1.4.2_04/jre/lib/ext/ldapsec.jar
    b5884000-b58a0000 r-xs 00000000 03:07 123039   /usr/java/j2sdk1.4.2_04/jre/lib/ext/sunjce_provider.jar
    b58a0000-b58bd000 r-xs 00000000 03:07 121032   /usr/java/j2sdk1.4.2_04/jre/lib/ext/comm.jar
    b58bd000-b58be000 r-xs 00000000 03:07 131550   /usr/java/j2sdk1.4.2_04/jre/lib/ext/ParallelPort.jar
    b58be000-b58bf000 r-xs 00000000 03:07 123761   /usr/java/j2sdk1.4.2_04/jre/lib/ext/SerialMRS.jar
    b58bf000-b58c2000 r-xs 00000000 03:07 123036   /usr/java/j2sdk1.4.2_04/jre/lib/ext/dnsns.jar
    b58c2000-b5e1b000 r-xs 00000000 03:07 123130   /usr/java/j2sdk1.4.2_04/jre/lib/charsets.jar
    b5e1b000-b5e2c000 r-xs 00000000 03:07 123129   /usr/java/j2sdk1.4.2_04/jre/lib/jce.jar
    b5e2c000-b5f07000 r-xs 00000000 03:07 123174   /usr/java/j2sdk1.4.2_04/jre/lib/jsse.jar
    b5f07000-b5f1d000 r-xs 00000000 03:07 123181   /usr/java/j2sdk1.4.2_04/jre/lib/sunrsasign.jar
    b5f67000-b7907000 r-xs 00000000 03:07 123614   /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar
    b7907000-b791b000 r-xp 00000000 03:07 123109   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libzip.so
    b791b000-b791e000 rwxp 00013000 03:07 123109   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libzip.so
    b791e000-b793e000 r-xp 00000000 03:07 123094   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libjava.so
    b793e000-b7940000 rwxp 0001f000 03:07 123094   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libjava.so
    b7940000-b7950000 r-xp 00000000 03:07 123108   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libverify.so
    b7950000-b7952000 rwxp 0000f000 03:07 123108   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libverify.so
    b7952000-b7956000 rwxs 00000000 03:07 129126   /tmp/hsperfdata_rafael/3909
    b7956000-b795f000 r-xp 00000000 03:07 500    /lib/libnss_files-2.3.5.so
    b795f000-b7961000 rwxp 00008000 03:07 500    /lib/libnss_files-2.3.5.so
    b7961000-b7962000 r-xp 00000000 03:07 131513   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libparport.so
    b7962000-b7963000 rwxp 00000000 03:07 131513   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libparport.so
    b7963000-b7967000 r-xp 00000000 03:07 26762   /usr/X11R6/lib/libXfixes.so.3.0
    b7967000-b7968000 rwxp 00003000 03:07 26762   /usr/X11R6/lib/libXfixes.so.3.0
    b7968000-b796d000 r-xp 00000000 03:07 26788   /usr/X11R6/lib/libXtst.so.6.1
    b796d000-b796e000 rwxp 00004000 03:07 26788   /usr/X11R6/lib/libXtst.so.6.1
    b796e000-b7975000 r-xp 00000000 03:07 26778   /usr/X11R6/lib/libXp.so.6.2
    b7975000-b7976000 rwxp 00006000 03:07 26778   /usr/X11R6/lib/libXp.so.6.2
    b7976000-b797e000 r-xp 00000000 03:07 123111   /usr/java/j2sdk1.4.2_04/jre/lib/i386/native_threads/libhpi.so
    b797e000-b797f000 rwxp 00007000 03:07 123111   /usr/java/j2sdk1.4.2_04/jre/lib/i386/native_threads/libhpi.so
    b797f000-b79a2000 r-xp 00000000 03:07 523    /lib/tls/libm-2.3.5.so
    b79a2000-b79a4000 rwxp 00022000 03:07 523    /lib/tls/libm-2.3.5.so
    b79a4000-b79b4000 r-xp 00000000 03:07 484    /lib/libnsl-2.3.5.so
    b79b4000-b79b6000 rwxp 0000f000 03:07 484    /lib/libnsl-2.3.5.so
    b79b8000-b7db3000 r-xp 00000000 03:07 123083   /usr/java/j2sdk1.4.2_04/jre/lib/i386/client/libjvm.so
    b7db3000-b7dce000 rwxp 003fa000 03:07 123083   /usr/java/j2sdk1.4.2_04/jre/lib/i386/client/libjvm.so
    b7de2000-b7f0b000 r-xp 00000000 03:07 521    /lib/tls/libc-2.3.5.so
    b7f0b000-b7f0c000 r-xp 00128000 03:07 521    /lib/tls/libc-2.3.5.so
    b7f0c000-b7f0f000 rwxp 00129000 03:07 521    /lib/tls/libc-2.3.5.so
    b7f11000-b7f13000 r-xp 00000000 03:07 480    /lib/libdl-2.3.5.so
    b7f13000-b7f15000 rwxp 00001000 03:07 480    /lib/libdl-2.3.5.so
    b7f15000-b7f23000 r-xp 00000000 03:07 525    /lib/tls/libpthread-0.10.so
    b7f23000-b7f25000 rwxp 0000d000 03:07 525    /lib/tls/libpthread-0.10.so
    b7f27000-b7f29000 r-xp 00000000 03:07 121363   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libSerialMRS.so
    b7f29000-b7f2a000 rwxp 00001000 03:07 121363   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libSerialMRS.so
    b7f2a000-b7f3a000 r-xp 00000000 03:07 123105   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libnet.so
    b7f3a000-b7f3b000 rwxp 0000f000 03:07 123105   /usr/java/j2sdk1.4.2_04/jre/lib/i386/libnet.so
    b7f3b000-b7f3c000 r-xs 00000000 03:07 128161   /home/softwares/eclipse/workspace/oxilabIII/SerialMRS.jar
    b7f3d000-b7f52000 r-xp 00000000 03:07 467    /lib/ld-2.3.5.so
    b7f52000-b7f53000 r-xp 00014000 03:07 467    /lib/ld-2.3.5.so
    b7f53000-b7f54000 rwxp 00015000 03:07 467    /lib/ld-2.3.5.so
    bfb3d000-bfb52000 rwxp bfb3d000 00:00 0     [stack]
    ffffe000-fffff000 ---p 00000000 00:00 0     [vdso]
     
    Heap at VM Abort:
    Heap
     def new generation  total 576K, used 438K [0xab6d0000, 0xab770000, 0xabbb0000)
     eden space 512K, 73% used [0xab6d0000, 0xab72d958, 0xab750000)
     from space 64K, 100% used [0xab750000, 0xab760000, 0xab760000)
     to  space 64K,  0% used [0xab760000, 0xab760000, 0xab770000)
     tenured generation  total 2572K, used 1921K [0xabbb0000, 0xabe33000, 0xaf6d0000)
      the space 2572K, 74% used [0xabbb0000, 0xabd907f8, 0xabd90800, 0xabe33000)
     compacting perm gen total 5120K, used 5113K [0xaf6d0000, 0xafbd0000, 0xb36d0000)
      the space 5120K, 99% used [0xaf6d0000, 0xafbce4f0, 0xafbce600, 0xafbd0000)
     
    Local Time = Tue Aug 15 09:56:12 2006
    Elapsed Time = 14
    #
    # The exception above was detected in native code outside the VM
    #
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode)
    #
    # An error report file has been saved as hs_err_pid3909.log.
    # Please refer to the file for further information.
    #








    Muito Obrigado!

  2. #2
    rafaelgimenes
    ninguem?






Tópicos Similares

  1. MOVIDO: Direitos /dev/lp0 > 0x378
    Por Duca no fórum Servidores de Rede
    Respostas: 0
    Último Post: 16-08-2006, 08:22
  2. Dev-C++
    Por Pinho no fórum Linguagens de Programação
    Respostas: 4
    Último Post: 27-06-2003, 05:00
  3. Sem direito no install do apache
    Por calthc no fórum Servidores de Rede
    Respostas: 2
    Último Post: 08-10-2002, 11:05
  4. Direitos
    Por MarcelScan no fórum Servidores de Rede
    Respostas: 0
    Último Post: 10-05-2002, 15:28
  5. Usuario com direitos ,...
    Por MarcelScan no fórum Servidores de Rede
    Respostas: 2
    Último Post: 29-03-2002, 00:31

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L