Home>

As the title says, it works well when run on Eclipse,
If i output to jar format and execute it, an error will occur.

I tried downloading 1-10 files on Eclipse and it worked.
However, if you try to download 1-15 files in jar format, 1-10 will be skipped
It's okay, but 11-15 has an error and I can't download it.

URL is specified. xx is the page number.

Why does Eclipse work, but can't download it in jar format?

[Environment]
OS: Windows10 Pro
IDE: Eclipse
Language: Java
1. Run on Eclipse
2. Convert to jar format and execute

When you log, it will be as follows.

(INFO szKeyword: Sword Art Online
(INFO num: 15
(DEBUG) m_szKeyword: Sword Art Online
(DEBUG) m_num: 15
(STEP1) 1/15
temp \ Sword Art Online 1.dat already exists.
(STEP1) 2/15
temp \ Sword Art Online 2.dat already exists.
(STEP1) 3/15
temp \ Sword Art Online 3.dat already exists.
(STEP1) 4/15
temp \ Sword Art Online 4.dat already exists.
(STEP1) 5/15
There is already temp \ Sword Art Online 5.dat.
(STEP1) 6/15
temp \ Sword Art Online 6.dat already exists.
(STEP1) 7/15
temp \ Sword Art Online 7.dat already exists.
(STEP1) 8/15
(STEP1) szURL: https: //prcm.jp/list/Sword Art Online? Page = 8
temp \ Sword Art Online 8.dat already exists.
(STEP1) 9/15
temp \ Sword Art Online 9.dat already exists.
(STEP1) 10/15
temp \ Sword Art Online 10.dat already exists.
(STEP1) 11/15
(INFO) szSaveFilename: temp \ Sword Art Online 11.dat
HTTP_NOT_FOUND
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (Unknown Source)
at java.lang.reflect.Constructor.newInstance (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection $10.run (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection $10.run (Unknown Source)
at java.security.AccessController.doPrivileged (Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0 (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream (Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream (Unknown Source)
at DownloadAndSave.go2 (DownloadAndSave.java:303)
at Analysis_Download.Step1 (Analysis_Download.java:93)
at analysis_download.start (analysis_download.java:274)
at JavaWindow.Get start (JavaWindow.java:92)
at JavaWindow $2.actionPerformed (JavaWindow.java:68)
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.plaf.basic.BasicButtonListener.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)
Caused by: java.io.FileNotFoundException: https://prcm.jp/list/Sword Art Online? Page = 11
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0 (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream (Unknown Source)
at java.net.HttpURLConnection.getResponseCode (Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode (Unknown Source)
at DownloadAndSave.go2 (DownloadAndSave.java:226)
... 40 more
(STEP1) 12/15
(INFO) szSaveFilename: temp \ Sword Art Online 12.dat
HTTP_NOT_FOUND
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (Unknown Source)
at java.lang.reflect.Constructor.newInstance (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection $10.run (Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection $10.run (Unknown Source)

  • Answer # 1

    I think it's a 90% character code problem if the operation is not as expected due to the environment of windows including Japanese.

    How about checking the following

    Arbitrary setting of file.encoding in Eclipse

    A story about garbled characters after running a jar created with Eclipse