Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

karl czukoski

Greenhorn
+ Follow
since Dec 30, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by karl czukoski

What I'm trying to do is have a data table show all user entries from a db user table. The process flow is to enter you sign up info name, email, username click submit and be sent to a view where the data table displays all distinct users (nothing overly practical other than playing around with primeface component and backing bean). Instead when the table renders it shows the same user over and over for how ever many rows are in the user db table. Attached is the UML file.
UserServiceImpl
*note when run in debug mode I get all users listed thus findAll() is working

UserManagedBean
dataTable.xhtml
applicationContext
webflow
8 years ago
Attempting to understand how to test a controller using Spring MVC Test framework.

The controller runs on the server without a problem
however when running the test
An ApplicationContext load error is thrown

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0'

In order to run the tests I added org.springframework.test-3.2.0.RELEASE.jar to the build path to allow for import of org.springframework.test.context.web.WebAppConfiguration (@WebAppConfiguration). Using MyEclipse's 'Add Spring Runtime Dependencies' it already had in place org.springframework.test-3.0.0.RELEASE.jar though the WebAppConfiguration import wasn't working with that version.

this post http://www.myeclipseide.com/PNphpBB2-viewtopic-t-27149.html seemed like it was going to help resolve this issue however I haven't had any luck yet.

Any ideas?




8 years ago
Put @Autowired at method

and seems to be working good now.

If I understand correctly since employeeManager property

was removed from dispatcher servlet
employeeManager needs to be autowired?
8 years ago
If I have


and


the employee property gets set from employeeManager reference

however when I try to use @Controller



and



why doesn't the employee property still get set (instead a null pointer exception occurs)?
8 years ago

Jeanne Boyarsky wrote:MLBControllerPage2 doesn't have a player manager injected or passed as a parameter. Therefore it can't compile because a dependency is missing.



Thanks Jeanne, could you provide some more detail or an example on how this particular injection is performed?
10 years ago
Hello Everybody, I am trying to figure out how to get the following query to work. In a jsp file, so named page1.jsp, contains

a href with a property listing name that a user selects such as "Phillies" ( ${teamsNLEast.name} ). This property name is then

passed into a variable called teamName to then be subsequently directed to the where clause in the following query.

Here is the class that contains the query and uses the getJdbcTemplate and query methods to process the sql statement, with the

where clause set to teamName, and assigns it to a List of players.

This is where the returned sql result from above will call the mapRow() method to match the value player_name in the database

and set it to the player object.

This class implements a getPlayers method that returns a playerlisting to a player data access object from the provided

teamName argument.

And finally my question arises at the Controller where the getPlayers method ought to be passed the teamName string. Though,

when I try to do that I'm receiving a compilation error. Does anyone have an idea on what I'm doing wrong? Your help is

greatly appreciated.


10 years ago
How should I go about fixing a classnotfound dispatcher servlet error ? the same app was loading earlier but now i keep getting

javax.servlet.ServletException: Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:851)
com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:84)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:278)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
root cause
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:851)
com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:84)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:278)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

i placed the spring-webmvc.jar in the classpath which i think contains org.springframework.web.servlet.DispatcherServlet and other combinations of various libraries but that hasn't solved it. any suggestions? also is there any place to pick up all the current dependencies for an mvc application?

thanks



10 years ago
I misunderstood

Now have:



but still the same error
10 years ago
InventoryManagerImpl is marked @Controller

jdbc-context.xml contains <tx:annotation-driven transaction-manager="transactionManager" />
10 years ago
Was wondering if someone can help me with an 'Injection of autowired dependencies failed':

INFO: Initializing Spring FrameworkServlet 'spring'

In ViewDVDController()

Oct 26, 2011 11:50:07 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'viewDVDController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationEapp structure.jpgxception: Could not autowire field: private springmvc.application.inventory.impl.InventoryMana gerImpl springmvc.presentation.ViewDVDController.manager; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [springmvc.application.inventory.impl.InventoryMana gerImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Aut owired(required=true)}

InventoryManagerImpl class:



ViewDVDController:



web.xml:


spring.properties:



spring-servlet:



jdbc-context.xml:




applicationContext.xml:
10 years ago
Wow, the web.xml and dispatcher-servlet.xml were tucked in a folder under the WEB-INF so I moved directly under WEB-INF and all seems cool, for the time being. Still curious though on how to enable debug logging for solving errors.

Thanks
10 years ago
Yep, tried that, still no luck. Where/what log file contains the errors?
10 years ago
I attempted shifting to the @RequestMapping(value="/viewAll", method=RequestMethod.GET) without luck. Perhaps I am missing a file in the build path? Files are attached.
10 years ago
I am new to Spring and am attempting an example but am puzzled as to why a MultiActionController constuctor is not getting called after a link is clicked from a index.html welcome file. There are no errors from the server just The requested resource is not available.

web.xml


index.html



spring-servlet
10 years ago
I am still having a difficult time understanding the descending order sort sequencing using the overridden compare, could i ask you to explain this in a little more detail?