Hallo Zusammen,
Ich habe gerade ein Problem mit Netzwerk zugriffen und weiss nicht so ganz was falsch ist.
Ich nutze ein SMB Protokoll um eine Datei zu Öffnen.
Wenn ich das bei mir in der Programmierumgebung teste Funktioniert alles einwandfrei.
Um das ganze nochmal auf einem anderen System zu testen habe ich ein .Jar datei erzeugt.
Sobald ich den die Netzwerk Datei öffnen will bekomme ich aber eine Exception.
So Ganz verstehe ich das nicht...
Hier ist nochmal der Codeausschnitt für die Funktion
Ich mache im Vorfeld auch noch einen Verbindungscheck der meldet mir das alles in Ordnung ist.
Hab ihr eine Ahnung woran das liegt?
Ich habe gerade ein Problem mit Netzwerk zugriffen und weiss nicht so ganz was falsch ist.
Ich nutze ein SMB Protokoll um eine Datei zu Öffnen.
Wenn ich das bei mir in der Programmierumgebung teste Funktioniert alles einwandfrei.
Um das ganze nochmal auf einem anderen System zu testen habe ich ein .Jar datei erzeugt.
Sobald ich den die Netzwerk Datei öffnen will bekomme ich aber eine Exception.
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: jcifs.smb.SmbFileInputStream.readAllBytes()[B
at DataImportExport.DataExportNetworkSMB.txtDateiIMPNetworkSMB(DataExportNetworkSMB.java:140)
at DataImportExport.DataExportNetwork.openFile(DataExportNetwork.java:106)
at ErpConfig.JWindowERPConfig.<init>(JWindowERPConfig.java:264)
at windows.JWindow$11.actionPerformed(JWindow.java:396)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[Finalizer] WARN jcifs.smb.SmbTreeHandleImpl - Tree handle was not properly released smb://192.168.91.20/Users/Administrator/Documents/mediquc.erpmng/erpconfig.json
[Finalizer] WARN jcifs.smb.SmbFileHandleImpl - File handle was not properly closed: FileHandle \Administrator\Documents\mediquc.erpmng\erpconfig.json [fid=8D0000000000000005000000FFFFFFFF,tree=3,flags=0,access=1,attrs=0,options=0]
So Ganz verstehe ich das nicht...
Hier ist nochmal der Codeausschnitt für die Funktion
Java:
public String txtDateiIMPNetworkSMB(String LoginName, String password, String NetworkPath, String FileName)
{
String content = "";
try {
BaseContext bc = new BaseContext(new PropertyConfiguration(System.getProperties()));
CIFSContext ct = bc.withCredentials(new NtlmPasswordAuthenticator(LoginName, password));
SmbResource sr = ct.get("smb:" + NetworkPath);// //192.168.178.157/TestNet/
if (sr.exists()) {
SmbFile file = new SmbFile(sr, FileName);
SmbFileInputStream in = new SmbFileInputStream("smb:" +NetworkPath+FileName, ct);
content = new String(in.readAllBytes());
in.close();
}
sr.close();
ct.close();
bc.close();
return content;
} catch (IOException e) {
e.printStackTrace();
}
return content;
}
Ich mache im Vorfeld auch noch einen Verbindungscheck der meldet mir das alles in Ordnung ist.
Hab ihr eine Ahnung woran das liegt?