[JBossCache] - Re: Urgent- Socket error when adding object to DB using JDBC
by malek256
After running a large number of tests, all of which repeatably and consistently fail in and around approximately 1970-1990 cache updates, I have made the following change.
After this change, the code then fails between 3900-4000 updates. It appears that this is a minor defect or at least a suboptimization with the original connection code.
The connection is stored into TLS during the NonManagedConnectionFactory.prepare() method but it seems it is not put in place after the null detect/create code within NonManagedConnectionFactory.getConnection.
I urge you to examine this.
e.g.
...
public Connection getConnection()
{
Connection con = (Connection) connection.get();
if(con == null)
{
try
{
con = DriverManager.getConnection(url, usr, pwd);
// CODE ADDED HERE
connection.set(con);
// END CODE MODIFICATION
}
catch(SQLException e)
...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976403#3976403
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976403
19 years, 7 months
[JBossWS] - A service endpoint interface should extend Remote excepiton
by MmarcoM
hi all,
i am trying to generate a wsdl for my EJB3 webservivce...
i keep on getting this exception
| log4j:WARN Please initialize the log4j system properly.
| Exception in thread "main" org.jboss.ws.WSException: A service endpoint interfac
| e should extend Remote
| at org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder.buildMetaData
| (ToolsUnifiedMetaDataBuilder.java:82)
| at org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder.<init>(ToolsU
| nifiedMetaDataBuilder.java:69)
| at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:298)
| at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(Too
| lsHelper.java:122)
| at org.jboss.ws.tools.WSTools.process(WSTools.java:132)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
| at org.jboss.ws.tools.WSTools.main(WSTools.java:61)
| C:\Sw\J2MEJobApp\ejbJ2ME>
|
what is weird is that my endpoint interface extedns Remote!!
| /**
| * Copyright @ 2006
| * By Marco Mistroni
| */
| package com.mm.j2me.ejb;
|
|
| import java.rmi.RemoteException;
|
| import javax.ejb.*;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.ws.annotation.PortComponent;
|
|
| import com.mm.j2me.core.Agency;
| import com.mm.j2me.core.WSFacade;
|
| @WebService (name="WSFacade",
| targetNamespace="http://org.jboss.ws/samples/jsr181ejb",
| serviceName="WSFacade",
| endpointInterface="com.mm.j2me.ejb.WSRemoteSEI")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
|
| public interface WSRemoteSEI extends Remote {
|
| public String testWebServiceMethod() throws RemoteException;
|
| }
|
anyone can help?
thanks and regards
marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976397#3976397
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976397
19 years, 7 months
[JBossWS] - help in generating WSDL
by MmarcoM
hi all,
can anyone help me out in how to generate WSDL for my EJB?
i have this very simple EJB3 that i want to expose a s a webService
here's the interface
| /**
| * Copyright @ 2006
| * By Marco Mistroni
| */
| package com.mm.j2me.ejb;
|
|
| import java.rmi.RemoteException;
|
| import javax.ejb.*;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.ws.annotation.PortComponent;
|
|
| import com.mm.j2me.core.Agency;
| import com.mm.j2me.core.WSFacade;
|
| @WebService (name="WSFacade",
| targetNamespace="http://org.jboss.ws/samples/jsr181ejb",
| serviceName="WSFacade",
| endpointInterface="com.mm.j2me.ejb.WSRemoteSEI")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
| use = SOAPBinding.Use.LITERAL,
| parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
| @PortComponent(transportGuarantee="NONE",
| contextRoot = "/",
| urlPattern="/v1/soap/WSFacade")
| public interface WSRemoteSEI extends Remote {
|
| public String[] testWebServiceMethod() throws RemoteException;
|
| }
|
here' smy simple EJB3
|
| @WebService (name="WSFacade",
| serviceName="WSFacade",
| endpointInterface="com.mm.j2me.ejb.WSRemoteSEI")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
| use = SOAPBinding.Use.LITERAL,
| parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
|
| @Stateless
| @Remote (WSFacade.class)
| @RemoteBinding( jndiBinding="/ejb3/WSRemoteSEI")
|
| public class TestFacade implements WSFacade{
|
| @PersistenceContext
| EntityManager em;
|
| public void deleteAgency(Agency agency) {
| // TODO Auto-generated method stub
| Query query = getQuery("findAgencyById");
| query.setParameter("id", agency.getId());
| Agency agencyToDelete = (Agency)query.getSingleResult();
| em.remove(agencyToDelete);
| }
|
| public void deleteJobApplication(JobApplication app) {
| Query query = getQuery("findJAById");
| query.setParameter("id", app.getId());
| JobApplication jaToDelete = (JobApplication)query.getSingleResult();
| em.remove(jaToDelete);
|
| }
|
| public void deleteOpportunity(Opportunity opp) {
| Query query = getQuery("findOpportunityById");
| query.setParameter("id", opp.getId());
| Opportunity oppToDelete = (Opportunity)query.getSingleResult();
| em.remove(oppToDelete);
|
| }
|
| public Agency[] getAllAgencies() {
| // TODO Auto-generated method stub
| Query query = getQuery("findAllAgencies");
| List<Agency> list = query.getResultList();
| Agency[] agencies = new Agency[list.size()];
| return (Agency[])(list.toArray(agencies));
| }
|
| public JobApplication[] getAllJobApplications() {
| return new JobApplication[]{};
| }
|
| public Opportunity[] getAllOpportunities() {
| //Query query = getQuery("findAllOpportunities");
| //return query.getResultList();
| return new Opportunity[]{};
| }
|
| public void insertAgency(Agency agency) {
| // TODO Auto-generated method stub
| em.persist(agency);
| }
|
| public void insertJobApplication(JobApplication app) {
| em.persist(app);
|
| }
|
| public void insertOpportunity(Opportunity opp) {
| em.persist(opp);
|
| }
|
| public User login(String username) {
| // TODO Auto-generated method stub
| return null;
| }
|
| private Query getQuery(String name) {
| return em.createNamedQuery(name);
| }
|
| @WebMethod
| public String testWebServiceMethod() {
| String[] agencies = {"agency1;job1;", "agency2;job2"};
| }
|
| }
|
i m runnign wstools with this cnfig file
| <?xml version="1.0" encoding="UTF-8"?>
| <configuration xmlns="http://www.jboss.org/jbossws-tools"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
|
| <wsdl-java file="http://localhost:9080//v1/soap/WSFacade?wsdl">
| <mapping file="jaxrpc-mapping-client.xml" />
| </wsdl-java>
|
| </configuration>
|
and all i got is plenty, plenty of generated classes:
Annotation, AnnotationType, AnnotationTypeResponse, Certificat, CertPath, Class, Classloader, CodeSigner
thing is that some classes does not even compile...
why does it generate all extra classes ? i need only 2 of them WSFacade_PortType adn WSFacade_Service
why do i have all those extra classes?
anyone could recommend me the easiest wayt ogenerate wsdl from java for jbossws?
thanks in advance and regards
marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976392#3976392
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976392
19 years, 7 months