Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got error when create the web.xml file in a running Liberty (dev mode) #30100

Open
gkwan-ibm opened this issue Nov 7, 2024 · 1 comment
Open
Labels
release bug This bug is present in a released version of Open Liberty

Comments

@gkwan-ibm
Copy link
Member

gkwan-ibm commented Nov 7, 2024

Describe the bug
For Win, start dev mode, create src/main/webapp/WEB-INF/web.xml file by an editor, before paste the content, OL throws an error. Then, paste the content and save the file, OL does not pick up the content and the application not work.

[INFO] javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
[INFO] Message: Premature end of file.
[INFO]  at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652)
[INFO]  at com.ibm.ws.javaee.ddmodel.DDParser.parseToRootElement(DDParser.java:984)
[INFO]  at [internal classes]
[INFO]  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[INFO]  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[INFO]  at java.base/java.lang.Thread.run(Thread.java:857)
[INFO] [ERROR   ] CWWKZ0004E: An exception occurred while starting the application guide-jakarta-faces. The exception message was: java.lang.IllegalStateException: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2272E: An error occurred while parsing the webapp : WEB-INF/web.xml deployment descriptor on line 1. The error message was: ParseError at [row,col]:[1,1]
[INFO] Message: Premature end of file.

FFDC:

------Start of DE processing------ = [11/7/24, 8:51:59:813 EST]
Exception = java.lang.IllegalStateException
Source = com.ibm.ws.app.manager.internal.statemachine.StartAction
probeid = 205
Stack Dump = java.lang.IllegalStateException: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2272E: An error occurred while parsing the webapp : WEB-INF/web.xml deployment descriptor on line 1. The error message was: ParseError at [row,col]:[1,1]
Message: Premature end of file.
	at com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.setUpApplicationMonitoring(WARApplicationHandlerImpl.java:54)
	at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:194)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1369)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.performAction(ApplicationStateMachineImpl.java:1233)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:920)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:857)
Caused by: com.ibm.wsspi.adaptable.module.UnableToAdaptException: com.ibm.ws.javaee.ddmodel.DDParser$ParseException: CWWKC2272E: An error occurred while parsing the webapp : WEB-INF/web.xml deployment descriptor on line 1. The error message was: ParseError at [row,col]:[1,1]

Steps to Reproduce

  • git clone https://github.com/OpenLiberty/draft-guide-jakarta-faces.git
  • cd draft-guide-jakarta-faces\start
  • mvn liberty:dev
  • create the file src\main\webapp\WEB-INF\web.xml

Expected behavior
If the file is empty, can OL skip to parse the file and not throw exception, so the developers can update the file content later?

Diagnostic information:

  • OpenLiberty Version: any
  • Affected feature(s): kernel filemonitor or web/faces feature
  • Java Version: any

Additional context

  • Potential it happens in Windows only
  • used Notepad
    • notepad src\main\webapp\WEB-INF\web.xml
  • or VS Code > New Files... > create the file
  • workaround: new file without path, paste the content, then save the file to the right path
@gkwan-ibm gkwan-ibm added the release bug This bug is present in a released version of Open Liberty label Nov 7, 2024
@gkwan-ibm
Copy link
Member Author

Mac has this issue too if touch the file

  • git clone https://github.com/OpenLiberty/draft-guide-jakarta-faces.git
  • cd draft-guide-jakarta-faces/start
  • mvn liberty:dev
  • touch src/main/webapp/WEB-INF/web.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release bug This bug is present in a released version of Open Liberty
Projects
None yet
Development

No branches or pull requests

1 participant