|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Message: "The parameter is incorrect." with jcifs 1.3.12Hi all,
I was trying to send a file to a shared printer on a Windows domain with Samba with the latest version of jcifs (1.3.12). Unfortunately I got the following exception: jcifs.smb.SmbException: The parameter is incorrect. at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542) at jcifs.smb.SmbTransport.send(SmbTransport.java:644) at jcifs.smb.SmbSession.send(SmbSession.java:224) at jcifs.smb.SmbTree.send(SmbTree.java:111) at jcifs.smb.SmbFile.send(SmbFile.java:770) at jcifs.smb.SmbFile.open0(SmbFile.java:975) at jcifs.smb.SmbFile.open(SmbFile.java:992) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67) Following is a capture of the communication with through samba, with confidential information filtered out: SmbComNegotiate[command=SMB_COM_NEGOTIATE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=1,wordCount=0,byteCount=12,wordCount=0,dialects=NT LM 0.12] New data read: Transport2[**DOMAIN**/**IP_DOMAIN**:0] 00000: FF 53 4D 42 72 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBr......È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 00 00 01 00 |..........:.....| SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=1,wordCount=17,byteCount=109,wordCount=17,dialectIndex=0,securityMode=0x7,security=user,encryptedPasswords=true,maxMpxCount=50,maxNumberVcs=1,maxBufferSize=4356,maxRawSize=65536,sessionKey=0x00000000,capabilities=0x8001F3FD,serverTime=Tue Sep 22 07:58:23 CEST 2009,serverTimeZone=65416,encryptionKeyLength=0,byteCount=109,oemDomainName=] treeConnect: unc=\\**DOMAIN**\IPC$,service=????? sessionSetup: accountName=**USER**,primaryDomain=**DOMAIN** SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=2,wordCount=12,byteCount=91,andxCommand=0xFF,andxOffset=0,snd_buf_size=4356,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,lmHash.length=0,ntHash.length=0,capabilities=-2147479468,accountName=null,primaryDomain=null,NATIVE_OS=Windows XP,NATIVE_LANMAN=jCIFS] New data read: Transport2[**DOMAIN**/**IP_DOMAIN**:0] 00000: FF 53 4D 42 73 16 00 00 C0 98 03 C8 00 00 00 00 |ÿSMBs...À..È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 00 28 02 00 |..........:..(..| SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=More data is available.,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=10240,mid=2,wordCount=4,byteCount=346,andxCommand=0xFF,andxOffset=389,isLoggedInAsGuest=false,nativeOs=Windows Server 2003 R2 3790 Service Pack 2,nativeLanMan=Windows Server 2003 R2 5.2,primaryDomain=] SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=10240,mid=3,wordCount=12,byteCount=381,andxCommand=0xFF,andxOffset=0,snd_buf_size=4356,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,lmHash.length=0,ntHash.length=0,capabilities=-2147479468,accountName=null,primaryDomain=null,NATIVE_OS=Windows XP,NATIVE_LANMAN=jCIFS] New data read: Transport2[**DOMAIN**/**IP_DOMAIN**:0] 00000: FF 53 4D 42 73 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBs......È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 00 28 03 00 |..........:..(..| SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=10240,mid=3,wordCount=4,byteCount=140,andxCommand=0xFF,andxOffset=183,isLoggedInAsGuest=false,nativeOs=Windows Server 2003 R2 3790 Service Pack 2,nativeLanMan=Windows Server 2003 R2 5.2,primaryDomain=] SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=10240,mid=4,wordCount=4,byteCount=43,andxCommand=0xFF,andxOffset=0,disconnectTid=false,passwordLength=1,password=,path=\\**DOMAIN**\IPC$,service=?????] New data read: Transport2[**DOMAIN**/**IP_DOMAIN**:0] 00000: FF 53 4D 42 75 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBu......È....| 00010: 00 00 00 00 00 00 00 00 01 18 3A 1B 00 28 04 00 |..........:..(..| SmbComTreeConnectAndXResponse[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=6145,pid=6970,uid=10240,mid=4,wordCount=3,byteCount=7,andxCommand=0xFF,andxOffset=48,supportSearchBits=true,shareIsInDfs=false,service=IPC,nativeFileSystem=] Trans2GetDfsReferral[command=SMB_COM_TRANSACTION2,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=6145,pid=6970,uid=10240,mid=5,wordCount=15,byteCount=5,totalParameterCount=4,totalDataCount=0,maxParameterCount=0,maxDataCount=4096,maxSetupCount=0,flags=0x00,timeout=0,parameterCount=4,parameterOffset=66,parameterDisplacement=0,dataCount=0,dataOffset=70,dataDisplacement=0,setupCount=1,pad=1,pad1=0,maxReferralLevel=0x3,filename=] New data read: Transport2[**DOMAIN**/**IP_DOMAIN**:0] 00000: FF 53 4D 42 32 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMB2......È....| 00010: 00 00 00 00 00 00 00 00 01 18 3A 1B 00 28 05 00 |..........:..(..| Trans2GetDfsReferralResponse[command=SMB_COM_TRANSACTION2,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=6145,pid=6970,uid=10240,mid=5,wordCount=10,byteCount=445,totalParameterCount=0,totalDataCount=444,parameterCount=0,parameterOffset=56,parameterDisplacement=0,dataCount=444,dataOffset=56,dataDisplacement=0,setupCount=0,pad=0,pad1=1,pathConsumed=0,numReferrals=8,flags=0] doConnect: **PRINTER_SHARE**/**IP** SmbComNegotiate[command=SMB_COM_NEGOTIATE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=1,wordCount=0,byteCount=12,wordCount=0,dialects=NT LM 0.12] New data read: Transport1[**PRINTER_SHARE**/**IP**:445] 00000: FF 53 4D 42 72 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBr......È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 00 00 01 00 |..........:.....| SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=1,wordCount=17,byteCount=109,wordCount=17,dialectIndex=0,securityMode=0x7,security=user,encryptedPasswords=true,maxMpxCount=50,maxNumberVcs=1,maxBufferSize=4356,maxRawSize=65536,sessionKey=0x00000000,capabilities=0x8001F3FD,serverTime=Tue Sep 22 07:58:24 CEST 2009,serverTimeZone=65416,encryptionKeyLength=0,byteCount=109,oemDomainName=] treeConnect: unc=\\**PRINTER_SHARE**\**PRINTER_NAME**,service=????? sessionSetup: accountName=**USER**,primaryDomain=**DOMAIN** SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=0,mid=2,wordCount=12,byteCount=91,andxCommand=0xFF,andxOffset=0,snd_buf_size=4356,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,lmHash.length=0,ntHash.length=0,capabilities=-2147479468,accountName=null,primaryDomain=null,NATIVE_OS=Windows XP,NATIVE_LANMAN=jCIFS] New data read: Transport1[**PRINTER_SHARE**/**IP**:445] 00000: FF 53 4D 42 73 16 00 00 C0 98 03 C8 00 00 00 00 |ÿSMBs...À..È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 01 08 02 00 |..........:.....| SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=More data is available.,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=2049,mid=2,wordCount=4,byteCount=346,andxCommand=0xFF,andxOffset=389,isLoggedInAsGuest=false,nativeOs=Windows Server 2003 R2 3790 Service Pack 2,nativeLanMan=Windows Server 2003 R2 5.2,primaryDomain=] SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=2049,mid=3,wordCount=12,byteCount=381,andxCommand=0xFF,andxOffset=0,snd_buf_size=4356,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,lmHash.length=0,ntHash.length=0,capabilities=-2147479468,accountName=null,primaryDomain=null,NATIVE_OS=Windows XP,NATIVE_LANMAN=jCIFS] New data read: Transport1[**PRINTER_SHARE**/**IP**:445] 00000: FF 53 4D 42 73 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBs......È....| 00010: 00 00 00 00 00 00 00 00 00 00 3A 1B 01 08 03 00 |..........:.....| SmbComSessionSetupAndXResponse[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=2049,mid=3,wordCount=4,byteCount=140,andxCommand=0xFF,andxOffset=183,isLoggedInAsGuest=false,nativeOs=Windows Server 2003 R2 3790 Service Pack 2,nativeLanMan=Windows Server 2003 R2 5.2,primaryDomain=] SmbComTreeConnectAndX[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=6970,uid=2049,mid=4,wordCount=4,byteCount=75,andxCommand=0xFF,andxOffset=0,disconnectTid=false,passwordLength=1,password=,path=\\**PRINTER_SHARE**\**PRINTER_NAME**,service=?????] New data read: Transport1[**PRINTER_SHARE**/**IP**:445] 00000: FF 53 4D 42 75 00 00 00 00 98 03 C8 00 00 00 00 |ÿSMBu......È....| 00010: 00 00 00 00 00 00 00 00 01 08 3A 1B 01 08 04 00 |..........:.....| SmbComTreeConnectAndXResponse[command=SMB_COM_TREE_CONNECT_ANDX,received=false,errorCode=0,flags=0x0098,flags2=0xC803,signSeq=0,tid=2049,pid=6970,uid=2049,mid=4,wordCount=3,byteCount=9,andxCommand=0xFF,andxOffset=50,supportSearchBits=true,shareIsInDfs=false,service=LPT1:,nativeFileSystem=] open0: \ SmbComNTCreateAndX[command=SMB_COM_NT_CREATE_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=2049,pid=6970,uid=2049,mid=5,wordCount=24,byteCount=5,andxCommand=0xFF,andxOffset=0,flags=0x00,rootDirectoryFid=0,desiredAccess=0x008B,allocationSize=0,extFileAttributes=0x0080,shareAccess=0x0007,createDisposition=0x0005,createOptions=0x00000040,impersonationLevel=0x0002,securityFlags=0x03,name=\] New data read: Transport1[**PRINTER_SHARE**/**IP**:445] 00000: FF 53 4D 42 A2 0D 00 00 C0 98 03 C8 00 00 00 00 |ÿSMB¢...À..È....| 00010: 00 00 00 00 00 00 00 00 01 08 3A 1B 01 08 05 00 |..........:.....| SmbComNTCreateAndXResponse[command=SMB_COM_NT_CREATE_ANDX,received=false,errorCode=The parameter is incorrect.,flags=0x0098,flags2=0xC803,signSeq=0,tid=2049,pid=6970,uid=2049,mid=5,wordCount=0,byteCount=0,andxCommand=0xFF,andxOffset=0,oplockLevel=0,fid=0,createAction=0x0000,creationTime=Thu Jan 01 01:00:00 CET 1970,lastAccessTime=Thu Jan 01 01:00:00 CET 1970,lastWriteTime=Thu Jan 01 01:00:00 CET 1970,changeTime=Thu Jan 01 01:00:00 CET 1970,extFileAttributes=0x0000,allocationSize=0,endOfFile=0,fileType=0,deviceState=0,directory=false] jcifs.smb.SmbException: The parameter is incorrect. at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542) at jcifs.smb.SmbTransport.send(SmbTransport.java:644) at jcifs.smb.SmbSession.send(SmbSession.java:224) at jcifs.smb.SmbTree.send(SmbTree.java:111) at jcifs.smb.SmbFile.send(SmbFile.java:770) at jcifs.smb.SmbFile.open0(SmbFile.java:975) at jcifs.smb.SmbFile.open(SmbFile.java:992) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97) at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67) If anyone knows how to fix this problem, it would help me very much. T.i.a. Regards, Dries |
|
|
Re: Message: "The parameter is incorrect." with jcifs 1.3.12I don't think you can write to a printer like that. I think the error
is probably unrelated to this fact but printers expect a certain data format nevertheless. If you studied a capture you could probably figure out the right flags and such to make the transport layer work. But again, you would need to write PostScript or PCL or whatever and it would all be very printer specific. In general JCIFS does not get into printing. Printing an extremely complex area. Mike On Wed, Sep 23, 2009 at 3:31 AM, drieschr <dries.christiaens@...> wrote: > > Hi all, > > I was trying to send a file to a shared printer on a Windows domain with > Samba with the latest version of jcifs (1.3.12). Unfortunately I got the > following exception: > jcifs.smb.SmbException: The parameter is incorrect. > at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542) > at jcifs.smb.SmbTransport.send(SmbTransport.java:644) > at jcifs.smb.SmbSession.send(SmbSession.java:224) > at jcifs.smb.SmbTree.send(SmbTree.java:111) -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ |
| Free embeddable forum powered by Nabble | Forum Help |