/
WSLogger.java
291 lines (215 loc) · 14.6 KB
/
WSLogger.java
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.webservices.logging;
import static org.jboss.logging.Logger.Level.ERROR;
import static org.jboss.logging.Logger.Level.FATAL;
import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;
import java.io.IOException;
import java.lang.reflect.Method;
import javax.xml.ws.WebServiceException;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.module.ResourceRoot;
import org.jboss.as.webservices.config.DisabledOperationException;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.StartException;
import org.jboss.vfs.VirtualFile;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
@MessageLogger(projectCode = "WFLYWS", length = 4)
public interface WSLogger extends BasicLogger {
WSLogger ROOT_LOGGER = Logger.getMessageLogger(WSLogger.class, "org.jboss.as.webservices");
@LogMessage(level = WARN)
@Message(id = 1, value = "Cannot load WS deployment aspects from %s")
void cannotLoadDeploymentAspectsDefinitionFile(String resourcePath);
RuntimeException cannotLoadDeploymentAspectsDefinitionFile(@Cause Throwable cause, String resourcePath);
@LogMessage(level = INFO)
@Message(id = 2, value = "Activating WebServices Extension")
void activatingWebservicesExtension();
@LogMessage(level = INFO)
@Message(id = 3, value = "Starting %s")
void starting(Object object);
@LogMessage(level = INFO)
@Message(id = 4, value = "Stopping %s")
void stopping(Object object);
@LogMessage(level = FATAL)
@Message(id = 5, value = "Error while creating configuration service")
void configServiceCreationFailed();
@LogMessage(level = ERROR)
@Message(id = 6, value = "Error while destroying configuration service")
void configServiceDestroyFailed();
@LogMessage(level = WARN)
@Message(id = 7, value = "Could not read WSDL from: %s")
void cannotReadWsdl(String wsdlLocation);
@LogMessage(level = WARN)
@Message(id = 8, value = "[JAXWS 2.2 spec, section 7.7] The @WebService and @WebServiceProvider annotations are mutually exclusive - %s won't be considered as a webservice endpoint, since it doesn't meet that requirement")
void mutuallyExclusiveAnnotations(String className);
@LogMessage(level = WARN)
@Message(id = 9, value = "WebService endpoint class cannot be final - %s won't be considered as a webservice endpoint")
void finalEndpointClassDetected(String className);
@LogMessage(level = WARN)
@Message(id = 10, value = "Ignoring <port-component-ref> without <service-endpoint-interface> and <port-qname>: %s")
void ignoringPortComponentRef(Object o);
@LogMessage(level = ERROR)
@Message(id = 11, value = "Cannot register record processor in JMX server")
void cannotRegisterRecordProcessor();
@LogMessage(level = ERROR)
@Message(id = 12, value = "Cannot unregister record processor from JMX server")
void cannotUnregisterRecordProcessor();
@LogMessage(level = INFO)
@Message(id = 13, value = "MBeanServer not available, skipping registration/unregistration of %s")
void mBeanServerNotAvailable(Object bean);
@LogMessage(level = WARN)
@Message(id = 14, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
void multipleEndpointsWithDifferentDeclaredSecurityRoles();
@LogMessage(level = ERROR)
@Message(id = 15, value = "Cannot register endpoint: %s in JMX server")
void cannotRegisterEndpoint(Object endpoint);
@LogMessage(level = ERROR)
@Message(id = 16, value = "Cannot unregister endpoint: %s from JMX server")
void cannotUnregisterEndpoint(Object endpoint);
@LogMessage(level = WARN)
@Message(id = 17, value = "Invalid handler chain file: %s")
void invalidHandlerChainFile(String fileName);
String WS_SPEC_REF_5_3_2_4_2 = ". See section 5.3.2.4.2 of \"Web Services for Java EE, Version 1.4\".";
@LogMessage(level = ERROR)
@Message(id = 18, value = "Web service method %s must not be static or final" + WS_SPEC_REF_5_3_2_4_2)
void webMethodMustNotBeStaticOrFinal(Method staticWebMethod);
@LogMessage(level = ERROR)
@Message(id = 19, value = "Web service method %s must be public" + WS_SPEC_REF_5_3_2_4_2)
void webMethodMustBePublic(Method staticWebMethod);
@LogMessage(level = ERROR)
@Message(id = 20, value = "Web service implementation class %s does not contain method %s")
void webServiceMethodNotFound(Class<?> endpointClass, Method potentialWebMethod);
@LogMessage(level = ERROR)
@Message(id = 21, value = "Web service implementation class %s does not contain an accessible method %s")
void accessibleWebServiceMethodNotFound(Class<?> endpointClass, Method potentialWebMethod, @Cause SecurityException e);
@LogMessage(level = ERROR)
@Message(id = 22, value = "Web service implementation class %s may not declare a finalize() method"
+ WS_SPEC_REF_5_3_2_4_2)
void finalizeMethodNotAllowed(Class<?> seiClass);
@Message(id = 23, value = "Null endpoint name")
NullPointerException nullEndpointName();
@Message(id = 24, value = "Null endpoint class")
NullPointerException nullEndpointClass();
@Message(id = 25, value = "Cannot resolve module or classloader for deployment %s")
IllegalStateException classLoaderResolutionFailed(Object o);
@Message(id = 26, value = "Handler chain config file %s not found in %s")
WebServiceException missingHandlerChainConfigFile(String filePath, ResourceRoot resourceRoot);
@Message(id = 27, value = "Unexpected element: %s")
IllegalStateException unexpectedElement(String elementName);
@Message(id = 28, value = "Unexpected end tag: %s")
IllegalStateException unexpectedEndTag(String tagName);
@Message(id = 29, value = "Reached end of xml document unexpectedly")
IllegalStateException unexpectedEndOfDocument();
@Message(id = 30, value = "Could not find class attribute for deployment aspect")
IllegalStateException missingDeploymentAspectClassAttribute();
@Message(id = 31, value = "Could not create a deployment aspect of class: %s")
IllegalStateException cannotInstantiateDeploymentAspect(@Cause Throwable cause, String className);
@Message(id = 32, value = "Could not find property name attribute for deployment aspect: %s")
IllegalStateException missingPropertyNameAttribute(DeploymentAspect deploymentAspect);
@Message(id = 33, value = "Could not find property class attribute for deployment aspect: %s")
IllegalStateException missingPropertyClassAttribute(DeploymentAspect deploymentAspect);
@Message(id = 34, value = "Unsupported property class: %s")
IllegalArgumentException unsupportedPropertyClass(String className);
@Message(id = 35, value = "Could not create list of type: %s")
IllegalStateException cannotInstantiateList(@Cause Throwable cause, String className);
@Message(id = 36, value = "Could not create map of type: %s")
IllegalStateException cannotInstantiateMap(@Cause Throwable cause, String className);
@Message(id = 37, value = "No metrics available")
String noMetricsAvailable();
@Message(id = 38, value = "Cannot find component view: %s")
IllegalStateException cannotFindComponentView(ServiceName viewName);
@Message(id = 39, value = "Child '%s' not found for VirtualFile: %s")
IOException missingChild(String child, VirtualFile file);
@Message(id = 40, value = "Failed to create context")
Exception createContextPhaseFailed(@Cause Throwable cause);
@Message(id = 41, value = "Failed to start context")
Exception startContextPhaseFailed(@Cause Throwable cause);
@Message(id = 42, value = "Failed to stop context")
Exception stopContextPhaseFailed(@Cause Throwable cause);
@Message(id = 43, value = "Failed to destroy context")
Exception destroyContextPhaseFailed(@Cause Throwable cause);
@Message(id = 44, value = "Cannot create servlet delegate: %s")
IllegalStateException cannotInstantiateServletDelegate(@Cause Throwable cause, String className);
@Message(id = 45, value = "Cannot obtain deployment property: %s")
IllegalStateException missingDeploymentProperty(String propertyName);
@Message(id = 46, value = "Multiple security domains not supported. First domain: '%s' second domain: '%s'")
IllegalStateException multipleSecurityDomainsDetected(String firstDomain, String secondDomain);
@Message(id = 47, value = "Web Service endpoint %s with URL pattern %s is already registered. Web service endpoint %s is requesting the same URL pattern.")
IllegalArgumentException sameUrlPatternRequested(String firstClass, String urlPattern, String secondClass);
@Message(id = 48, value = "@WebServiceRef injection target is invalid. Only setter methods are allowed: %s")
DeploymentUnitProcessingException invalidServiceRefSetterMethodName(Object o);
@Message(id = 49, value = "@WebServiceRef attribute 'name' is required for class level annotations.")
DeploymentUnitProcessingException requiredServiceRefName();
@Message(id = 50, value = "@WebServiceRef attribute 'type' is required for class level annotations.")
DeploymentUnitProcessingException requiredServiceRefType();
@Message(id = 51, value = "Config %s doesn't exist")
OperationFailedException missingConfig(String configName);
@Message(id = 52, value = "Unsupported handler chain type: %s. Supported types are either %s or %s")
StartException wrongHandlerChainType(String unknownChainType, String knownChainType1, String knownChainType2);
@Message(id = 53, value = "Cannot add new handler chain of type %s with id %s. This id is already used in config %s for another chain.")
StartException multipleHandlerChainsWithSameId(String chainType, String handlerChainId, String configId);
@Message(id = 54, value = "Config %s: %s handler chain with id %s doesn't exist")
OperationFailedException missingHandlerChain(String configName, String handlerChainType, String handlerChainId);
// @Message(id = 55, value = "Config %s, %s handler chain %s: doesn't contain handler with name %s")
// OperationFailedException missingHandler(String configName, String handlerChainType, String handlerChainId, String handlerName);
//@LogMessage(level = ERROR)
//@Message(id = 56, value = "Method invocation failed with exception: %s")
//void methodInvocationFailed(@Cause Throwable cause, String message);
@Message(id = 57, value = "Unable to get URL for: %s")
DeploymentUnitProcessingException cannotGetURLForDescriptor(@Cause Throwable cause, String resourcePath);
@Message(id = 58, value = "JAX-RPC not supported")
DeploymentUnitProcessingException jaxRpcNotSupported();
@Message(id = 59, value = "%s library (%s) detected in ws endpoint deployment; either provide a proper deployment replacing embedded libraries with container module "
+ "dependencies or disable the webservices subsystem for the current deployment adding a proper jboss-deployment-structure.xml descriptor to it. "
+ "The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.")
DeploymentUnitProcessingException invalidLibraryInDeployment(String libraryName, String jar);
@Message(id = 60, value = "Web service endpoint class %s not found")
DeploymentUnitProcessingException endpointClassNotFound(String endpointClassName);
@Message(id = 61, value = "The endpointInterface %s declared in the @WebService annotation on web service implementation bean %s was not found.")
DeploymentUnitProcessingException declaredEndpointInterfaceClassNotFound(String endpointInterface, Class<?> endpointClass);
@Message(id = 62, value = "Class verification of Java Web Service implementation class %s failed.")
DeploymentUnitProcessingException jwsWebServiceClassVerificationFailed(Class<?> seiClass);
@Message(id = 63, value = "Could not update WS server configuration because of pending former model update(s) requiring reload.")
DisabledOperationException couldNotUpdateServerConfigBecauseOfReloadRequired();
@Message(id = 64, value = "Could not update WS server configuration because of existing WS deployment on the server.")
DisabledOperationException couldNotUpdateServerConfigBecauseOfExistingWSDeployment();
@LogMessage(level = WARN)
@Message(id = 65, value = "Annotation '@%s' found on class '%s'. Perhaps you forgot to add a '%s' module dependency to your deployment?")
void missingModuleDependency(String annotation, String clazz, String module);
@Message(id = 66, value = "Servlet class %s declared in web.xml; either provide a proper deployment relying on JBossWS or disable the webservices subsystem for the "
+ "current deployment adding a proper jboss-deployment-structure.xml descriptor to it. "
+ "The former approach is recommended, as the latter approach causes most of the webservices Java EE and any JBossWS specific functionality to be disabled.")
WSFException invalidWSServlet(String servletClass);
}