Tag Archives: Failed to start component

Error: Failed to start component [How to Solve]

Error message: caused by: failed to start component

Start to check whether the configured URL pattern is wrong, including using annotation, but it still reports an error and fails to start

Finally, I read the error report diary carefully and found that: caused by: java.lang.noclassdeffounderror: COM/sun/deploy/net/httprequest

Error reporting reason:

Solution: change the receiving parameter type

public void findAll(HttpServletRequest request, HttpServletResponse response){...}

This bug has been tangled for a long time. Record the PS receiving parameter type. It’s inexplicable. You need to read the source code to fully understand it

Solution to the exception of failed to start component

Exception occurred:

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/uploadFile]]

Through Baidu what positioning, is Tomcat server.xml Configuration issues <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" /> <Context path="/uploadFile" docBase="/home/admin/uploadFile" debug="0" reloadable="true" /> </Host> </Engine> </Service> </Server>

This is the last server.xml The last few lines in. When he sees the UploadFile, he will store it in the folder/home/admin/UploadFile
go to the/home/admin/directory to check whether the UploadFile folder exists, and then it is sure that it does not exist. Then create, create an UploadFile folder, and then start it.