Re: [jboss-user] [JBoss Web Services] - Deploying ws with custom JAXBContext
by Artem Oboturov
Artem Oboturov [http://community.jboss.org/people/ArtemOboturov] replied to the discussion
"Deploying ws with custom JAXBContext"
To view the discussion, visit: http://community.jboss.org/message/555845#555845
--------------------------------------------------------------
Example below is based on http://weblogs.java.net/blog/jitu/archive/2008/08/control_of_jaxb.html http://weblogs.java.net/blog/jitu/archive/2008/08/control_of_jaxb.html.
Specify custom JAXBContextFactory on top of your webserice. Create new JAXBRIContext and pass an annotation processor to it. BaseJAXBContextFactory is under your control.
At least jaxws-rt 2.1.5 must be used internally by jboss.
Hope this will help.
@WebService(....)
@UsesJAXBContext(BaseJAXBContextFactory.class)
public class YourWebServiceBean
{
....
}
public class BaseJAXBContextFactory implements JAXBContextFactory
{
@Override
public JAXBRIContext createJAXBContext(SEIModel seiModel, List<Class> classes, List<TypeReference> typeReferences) throws JAXBException
{
Class[] arg = classes.toArray(new Class[classes.size()]);
JAXBRIContext context = JAXBRIContext.newInstance(
arg,
typeReferences,
null,
seiModel.getTargetNamespace(),
false,
null // TODO: annotation processor should be put there
);
return (JAXBRIContext)Proxy.newProxyInstance(getClass().getClassLoader(),
new Class[]{ JAXBRIContext.class },
new JAXBContextInvocationHandler());
}
}
public class JAXBContextInvocationHandler implements InvocationHandler
{
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
Object object = method.invoke(context, args);
return object;
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/555845#555845]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months
[EJB 3.0] - Jboss not starting properly (Error starting ServerSocket. Bind port: 3873, bind address)
by varun Nidhi
varun Nidhi [http://community.jboss.org/people/varunnidhi30] created the discussion
"Jboss not starting properly (Error starting ServerSocket. Bind port: 3873, bind address)"
To view the discussion, visit: http://community.jboss.org/message/555800#555800
--------------------------------------------------------------
Hi Everyone,
I have an EAR file which contains packaged stateless beans , ejb timers , servlets.
The server startup is integrated with the system startup so as the system starts it starts Jboss also.
Normally when I start system JBoss also gets started and EAR is properly deployed.
The problem which I am facing is that sometimes when power outage occurs and the system restarts again, hence starting JBoss also then
it is not able to deploy ejbs, getting error:
2010-02-03 23:49:01,141 ERROR [main - SocketServerInvoker] - Error starting Servv
erSocket. Bind port: 3873, bind address:
2010-02-03 23:49:01,141 ERROR [main - Connector] - Error starting connector.
java.net.BindException: Can't assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFF
actory.java:169)
at org.jboss.remoting.transport.socket.SocketServerInvoker.createServerSS
ocket(SocketServerInvoker.java:264)
at org.jboss.remoting.transport.socket.SocketServerInvoker.start(SocketSS
erverInvoker.java:193)
at org.jboss.remoting.transport.Connector.start(Connector.java:322)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)Native library which allows optimal performance in production environments was nn
ot found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Jaa
va/Extensions:/usr/lib/java
2010-02-03 23:49:15,676 ERROR [main - Http11Protocol] - Error initializing endpoo
int
java.net.BindException: Can't assign requested address:6000
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:500)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1077
3)
at org.apache.catalina.core.StandardService.initialize(StandardService.jj
ava:668)
Though doing a stop ,start from Jboss scripts (using shutdown.sh and run.sh) after facing this error , every thing gets deployed properly.
Can anyone please help .
The various details are:
JBoss version : above 4.2.
Ejb version : ejb 3
System : MAC OS Snow Leopard Version 10.6
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/555800#555800]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 8 months