我可以在 Hotswap Agent 上添加新课程吗?我尝试更改名称方法、方法体、字段,并且工作正常,但是当我添加新类并在另一个应用程序崩溃时调用它时,不要执行该类的内容并且不显示错误。
package test;
public class TestNewClass
{
public void test()
{
System.out.println("test new class");
}
}
@Controller
public class MenuController extends MainController
{
@RequestMapping(value = "/menu/getMenu", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE_UTF_8)
@ResponseBody
public String getMenu(HttpServletResponse httpRessponse)
{
System.out.println("test 3 "+test);
UserVitrina user = getUserVitrina();
MenuHandler menuHandler = new MenuHandler();
try
{
genericBO.openSessionTransaction();
Map menu = menuHandler.getMenu(user.getIdUsuario());
genericBO.commitTransaction();
return new Gson().toJson(menu);
}
catch (Exception ex)
{
new Log().printLogError("MENU. Error obtener menu.", ex, (user == null ? "usuario nulo" : user.getUsername()), null, Resources.LogName.DEBUG);
httpRessponse.setStatus(HttpStatus.BAD_GATEWAY.value());
genericBO.abortTransaction();
return new Gson().toJson(new MessageServer().generateMessageError(ex));
}
finally
{
genericBO.closeSession();
}
}
}