servlet

Nullpointer exception thrown when running Sprint Boot with Spring MVC

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am building spring mvc project with spring boot but I am unable to start my web application . I have followed the couple of tutorials but cant figure it out. I could start my application with spring boot but when i add Spring mvc, it starts to throw an error. I am getting a following error java.lang.NullPointerException: null at org.springframework.core.BridgeMethodResolver.findBridgedMethod(BridgeMethodResolver.java:60) at org.springframework.beans.GenericTypeAwarePropertyDescriptor.(GenericTypeAwarePropertyDescriptor.java:70) at org

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains'

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I created a new Project with STS, Roo and GWT and tried to include Spring Security. Since then i get the following error. Has anyone got an idea what went wrong?! org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: NULL Stacktrace: [INFO] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Initialization of

How do I suppress Jetty 8's default ErrorHandler?

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Jetty is helping my application too much. Whenever some unhandled Exception leaks out the top, Jetty takes it upon itself to build a very verbose response and spam it onto my clients HTTP / 1.1 500 com . mongodb . MongoException : No replica set members available in [ { address : 'localhost/127.0.0.1:27017' , ok : true , ping : 0.49878865 , isMaster : false , isSecondary : true , setName : dmReplSet , maxBsonObjectSize : 16777216 , },{ address : 'localhost/127.0.0.1:27018' , ok : true , ping : 0.2565605 , isMaster : false ,

Spring security login-processing-url throws 405 request method POST not supported

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i'm working with spring security 3.1.3 in a spring 3.2.0 project. I've configured two entry points for my security using spring security. The idea is to have a url like /enterprise_login where enterprise users should log in and other url like /login where normal users do their log in action. In my security configuration i've the next code <security:global-method-security jsr250-annotations="enabled" pre-post-annotations="enabled" secured-annotations="enabled" /> <security:http pattern="/enterprise/**" auto-config="false" use-expressions=

Error creating bean with name &#039;requestMappingHandlerAdapter&#039;

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Am creating a simple REST service using Springframework with Tomcat. The response should have to be in json like {"id":"101","name":"Ram"} .When ever I run, am getting the following error org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org

How to pass parameters from Servlet via Bean to JSP page with the help of Session?

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As mentioned below I have made changes to the code which looks like following example, but it doesn't show firstname and lastname in JSP: Servlet code: //.... HttpSession session = request.getSession(); Person person = (Person) session.getAttribute("person"); if (person == null) { person = new Person(); } person.setNewId(newId); person.setFirstName(firstName); person.setLastName(lastName); session.setAttribute("person", person); RequestDispatcher rd = request.getRequestDispatcher("jsp Address"); rd.forward(request, response); Person Bean

error while including external JARs in ant script

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my first attempt at writing an ANT script. This is my build.xml for a simple Hello World app using Spring. <project name="MyFirstApp" default="jar" basedir=".."> <property name="src" location="src"/> <property name="build" location="build"/> <property name="lib" location="/WebContent/WEB-INF/lib"/> <path id="classpath-example"> <fileset dir="${build}" includes="*.jar"/> </path> <target name="clean"> <delete dir="build"/> </target> <target name="compile"> <mkdir dir="build/classes"/> <javac srcdir="${src}" destdir="build/classes"

Java - Servlet 404 error [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Servlet returns “HTTP Status 404 The requested resource (/servlet) is not available” 2 answers I am a newbie in servlet programming. The following is my sample servlet code Sample.Java public class Sample extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter pw=res.getWriter(); String name=req.getParameter("name");//will return value pw.println("Welcome "+name); pw.close(); } }

web service exposed by extending SpringBeanAutowiringSupport is failing to inject @Autowired dependencies

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My web service exposed by extending SpringBeanAutowiringSupport is failing to inject @Autowired dependencies. Web service deploys fine and I'm able to invoke the @WebMethod but I'm getting a NullPointerException due to the failed injection. I put System.out.println("Consructing XmlContactMapper..."); in the constructor of XmlContactMapper (one of my dependencies with @Autowired). When I deploy the web service I see the debug line so I know the constructor is being invoked. But for some reason an instance of XmlContactMapper isn't being

No mapping found for HTTP request with URI [/myproject/] in DispatcherServlet with name &#039;appServlet&#039; [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? 3 answers I'm absolutely newbie with Java and Spring and I want to learn from example. I'm using an out-of-the-box configuration / installation Mac OSX Springsource Tool Suite as IDE Spring 2.8.1.RELEASE vfabric-tc-server-developer-2.6.1.RELEASE I've tried to generate a new project based on "Spring Template Project". Then I've chosen the "Spring MVC Project". The sample project is