Bonjour,
J'utilise du pure java pour la réalisation des pages web et cela me pose d'énorme difficulté pour l'intégration de la sécurité.
Le simple fait d'utiliser des classes java, peut il poser ces problèmes.
les infos et les erreur
web xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140 26-juil.-2012 12:13:43 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\Java\jdk1.6.0_21\bin\;;C:\Program Files\hellios;;. 26-juil.-2012 12:13:44 org.apache.tomcat.util.digester.SetPropertiesRule begin ATTENTION: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:be.crossviewer' did not find a matching property. 26-juil.-2012 12:13:44 org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] 26-juil.-2012 12:13:44 org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 26-juil.-2012 12:13:44 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 742 ms 26-juil.-2012 12:13:44 org.apache.catalina.core.StandardService startInternal INFO: Démarrage du service Catalina 26-juil.-2012 12:13:44 org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.28 26-juil.-2012 12:13:48 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext 26-juil.-2012 12:13:48 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started 26-juil.-2012 12:13:48 org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing Root WebApplicationContext: startup date [Thu Jul 26 12:13:48 CEST 2012]; root of context hierarchy 26-juil.-2012 12:13:48 org.springframework.web.context.ContextLoader initWebApplicationContext GRAVE: Context initialization failed java.lang.ExceptionInInitializerError at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:527) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:441) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5284) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:109) ... 17 more 26-juil.-2012 12:13:48 org.apache.catalina.core.StandardContext listenerStart GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener java.lang.ExceptionInInitializerError at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:527) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:441) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5284) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:109) ... 17 more 26-juil.-2012 12:13:48 org.apache.catalina.core.StandardContext startInternal GRAVE: Error listenerStart 26-juil.-2012 12:13:48 org.apache.catalina.core.StandardContext startInternal GRAVE: Erreur de démarrage du contexte [/be.crossViewer] suite aux erreurs précédentes 26-juil.-2012 12:13:48 org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext 26-juil.-2012 12:13:48 org.springframework.context.support.AbstractApplicationContext doClose INFO: Closing Root WebApplicationContext: startup date [Thu Jul 26 12:13:48 CEST 2012]; root of context hierarchy 26-juil.-2012 12:13:48 org.springframework.context.support.AbstractApplicationContext doClose ATTENTION: Exception thrown from ApplicationListener handling ContextClosedEvent java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Thu Jul 26 12:13:48 CEST 2012]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:337) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1030) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4830) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5477) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 26-juil.-2012 12:13:48 org.springframework.context.support.AbstractApplicationContext doClose ATTENTION: Exception thrown from LifecycleProcessor on context close java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Thu Jul 26 12:13:48 CEST 2012]; root of context hierarchy at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1038) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4830) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5477) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 26-juil.-2012 12:13:48 org.apache.catalina.core.StandardContext listenerStop GRAVE: Exception lors de l'envoi de l'évènement contexte détruit (context destroyed) à l'instance de classe d'écoute org.springframework.web.context.ContextLoaderListener java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1071) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1045) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4830) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5477) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1595) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1585) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 26-juil.-2012 12:13:48 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] 26-juil.-2012 12:13:48 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] 26-juil.-2012 12:13:48 org.apache.catalina.startup.Catalina start INFO: Server startup in 4047 ms
application context
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 <servlet-mapping> <servlet-name>zkLoader</servlet-name> <url-pattern>/richlet/*</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:ctx/securityContext.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class> org.springframework.security.web.session.HttpSessionEventPublisher</listener-class> </listener> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <http auto-config="true" use-expressions="true" access-denied-page="/"> <intercept-url pattern="/*" access="Permitall()" /> <intercept-url pattern="/*" access="Permitall()" /> <intercept-url pattern="/*" access="Permitall()" /> <form-login login-page="/be.crossviewer/login/Indentifier" authentication-failure-url="/" /> <logout logout-url="/log/logout" logout-success-url="/" invalidate-session="true" /> </http> <authentication-manager alias="authentication-manager"> <authentication-provider> <jdbc-user-service data-source-ref="dataSourceSecurity" users-by-username-query="select name, code, activate from person where name=? and activate=true" authorities-by-username-query= "SELECT `name`, CONCAT('ROLE_', UPPER(role)) FROM person INNER JOIN `access-roles` ON person.person_id = `access-roles`.access_id WHERE `name` = ? AND `access-roles`.activate=TRUE" /> </authentication-provider> </authentication-manager> <beans:bean id="dataSourceSecurity" class="org.apache.commons.dbcp.BasicDataSource"> <beans:property name="driverClassName"> <beans:value>com.mysql.jdbc.Driver</beans:value> </beans:property> <beans:property name="url" value="jdbc:mysql://localhost:3306/crossmanager" /> <beans:property name="username" value="root" /> <beans:property name="password" value="root" /> </beans:bean> </beans:beans>
Partager