401 Unauthorized Error Occurs With Java API (Doc ID 1482728.1)

Last updated on SEPTEMBER 21, 2016

Applies to:

Oracle Lite - Version 10.3.0.3.0 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Jan-2014***

Symptoms

On : 10.3.0.3.0 version, Mobile Server

When attempting to publish 2 mobile Applications
the following error occurs.

ERROR
-----------------------

C:\SRS\BDE\Bug_PUBLISH_JAR_API>java TestcasePublish
=======================================================================================
= CONNECTION TO MOBILE SERVER =
=======================================================================================
Connected to Mobile Server Lite
=======================================================================================
= First PUBLICATION =
=======================================================================================
inside jupdevworkspace === C:\SRS\BDE\Bug_PUBLISH_JAR_API\APP_TEST1.jar
Register the app to  /publish
====================APP_TEST1====================
Date: Mon Aug 06 12:04:17 CEST 2012
url is http://vm-mobileserver1.fr.oracle.com:7001/webtogo/ path is publish
status is VALID http://vm-mobileserver1.fr.oracle.com:7001/webtogo/userinfo/logon
url is http://vm-mobileserver1.fr.oracle.com:7001/webtogo/ path is
status is VALID http://vm-mobileserver1.fr.oracle.com:7001/webtogo/userinfo/logon
Uploading web.xml to /web.xml from APP_TEST1.jar size: 439 status : 202
Completing publishing.
=======================================================================================
= Second PUBLICATION =
=======================================================================================
inside jupdevworkspace === C:\SRS\BDE\Bug_PUBLISH_JAR_API\APP_TEST2.jar
Register the app to  /publish
====================APP_TEST2====================
Date: Mon Aug 06 12:04:21 CEST 2012
url is http://vm-mobileserver1.fr.oracle.com:7001/webtogo/ path is publish
status is VALID http://vm-mobileserver1.fr.oracle.com:7001/webtogo/userinfo/logon
java.lang.Exception: 401
Unauthorized
      at oracle.lite.web.xml.JupDevApp.publishDef(Unknown Source)
      at oracle.lite.web.xml.JupDevApp.register(Unknown Source)
      at oracle.lite.web.xml.JupDevApp.register(Unknown Source)
      at oracle.lite.web.JupDevWorkspace.registerJar(Unknown Source)
      at oracle.mobile.admin.MobileResourceManager.publishApplication(Unknown Source)
      at TestcasePublish.main(TestcasePublish.java:82)
java.lang.Exception: 401
Unauthorized
      at oracle.lite.web.xml.JupDevApp.publishDef(Unknown Source)
      at oracle.lite.web.xml.JupDevApp.register(Unknown Source)
      at oracle.lite.web.xml.JupDevApp.register(Unknown Source)
      at oracle.lite.web.JupDevWorkspace.registerJar(Unknown Source)
      at oracle.mobile.admin.MobileResourceManager.publishApplication(Unknown Source)
      at TestcasePublish.main(TestcasePublish.java:82)



STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1.create a java code, which will publish 2 mobile applications.
2. run it

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms