Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » dbws utils generated war file gives error : _dbws.DBWSProvider is not available (after loading war, generated by dbws builder, tomcat gives "_dbws.DBWSProvider is not available" error)
dbws utils generated war file gives error : _dbws.DBWSProvider is not available [message #995648] Sun, 30 December 2012 14:36 Go to next message
halil agin is currently offline halil agin
Messages: 2
Registered: December 2012
Junior Member
Hi List,

I am new to this forum. I am trying to use dbwsbuilder to generate a web service from a table. I got the generated .war file and loaded to the tomcat6. When I request the address it gives below error

_dbws.DBWSProvider is not available


I searched net and found below link:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=307897

It says that it is a bug and to recover it you have to compile \org\eclipse\persistence\tools\dbws\ProviderPackager.java with ASM 3.1 or 3.2

Every thing is ok till now, but i cannot find the source code of the dbwsbuilder.

How can I find it?

thanks in advance,

-halil.
Re: dbws utils generated war file gives error : _dbws.DBWSProvider is not available [message #997070 is a reply to message #995648] Thu, 03 January 2013 09:29 Go to previous messageGo to next message
David McCann is currently offline David McCann
Messages: 20
Registered: July 2009
Junior Member
Hi Halil,

EclipseLink installs and source can be found on the EclipseLink download site:

http://www.eclipse.org/eclipselink/downloads/

This page also contains links to:

Previous Releases
Milestones Builds
Nightly Builds

Cheers,
Dave
Re: dbws utils generated war file gives error : _dbws.DBWSProvider is not available [message #1007256 is a reply to message #997070] Tue, 05 February 2013 04:39 Go to previous messageGo to next message
halil agin is currently offline halil agin
Messages: 2
Registered: December 2012
Junior Member
Hi David,

Sorry for late response.

I downloaded the latest version and compiled with ant successfully. But, now i have a different problem. Here is the list of my steps.


1. download eclipselink.runtime-2.5.0-M6
2. setting up ant 1.7.1 maven 3.0.4 and jdk 6.update.38
3. ant -f antbuild.xml
4. ant -f antbuild.xml build-distribution
5. copy eclipselink.zip and unzip to an empty directory.
6. cd ${eclipselink-workdir}/eclipselink/utils/dbws
7.create dbws builder xml file as below

<?xml version="1.0" encoding="UTF-8"?>
<dbws-builder xmlns:xsd="{2001-XMLSchema-url-address}">
<properties>
<property name="projectName">test11</property>
<property name="logLevel">fine</property>
<property name="username">halil</property>
<property name="password">123456</property>
<property name="url">jdbc:mysql://localhost:3306/testdb</property>
<property name="driver">com.mysql.jdbc.Driver</property>
<property name="platformClassname">org.eclipse.persistence.platform.database.MySQLPlatform</property>

<property name="dataSource">jdbc/test10-glf-ds</property>
<property name="wsdlLocationURI">{my-wsdl-address}</property>

</properties>
<table
catalogPattern="%"
tableNamePattern="table1"
/>
</dbws-builder>


8. run below command

./dbwsbuilder.sh -builderFile testdb-mysql-dbws-builder.xml -stageDir testdb_out -packageAs glassfish

9. copy newly builded jar file into glassfish3/modules directory. jar list is below (i added also mysql driver)

-rw-r--r-- 1 halil halil 832960 Feb 4 02:43 mysql-connector-java-5.1.22-bin.jar
-rw-r--r-- 1 halil halil 177593 Feb 4 03:07 org.eclipse.persistence.antlr_3.2.0.v201206041011.jar
-rw-r--r-- 1 halil halil 257816 Feb 4 03:08 org.eclipse.persistence.asm_3.3.1.v201206041142.jar
-rw-r--r-- 1 halil halil 4823609 Feb 4 03:09 org.eclipse.persistence.core_2.5.0.qualifier.jar
-rw-r--r-- 1 halil halil 226557 Feb 5 03:27 org.eclipse.persistence.dbws_2.5.0.qualifier.jar
-rw-r--r-- 1 halil halil 1079900 Feb 4 03:11 org.eclipse.persistence.jpa_2.5.0.qualifier.jar
-rw-r--r-- 1 halil halil 44105 Feb 4 03:12 org.eclipse.persistence.jpa.modelgen_2.5.0.qualifier.jar
-rw-r--r-- 1 halil halil 463985 Feb 5 02:53 org.eclipse.persistence.moxy_2.5.0.qualifier.jar
-rw-r--r-- 1 halil halil 80321 Feb 4 03:13 org.eclipse.persistence.oracle_2.5.0.v20121210-c6212b3.jar


10. open constructed war (at step Cool and fix the files
10.1 fix the dbws-or.xml file path as below

<primary-project xsi:type="xml">META-INF/eclipselink-dbws-or.xml</primary-project>

10.2 add below xml fragment into the session tag

<session xsi:type="database-session">
<name>test-dbws-ox-session</name>
<logging xsi:type="eclipselink-log">
<log-level>all</log-level>
</logging>
<primary-project xsi:type="xml">META-INF/eclipselink-dbws-ox.xml</primary-project>
</session>

10.3 there is xml-bindings-list tag in the dbws-ox.xml file but it is not defined in the xsd file. and i changed the dbws-ox.xml as below. Before changing, i was getting the error ( A descriptor with default root element {http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-bindings-list was not found in the project)


<xml-bindings package-name="test11" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">

<xml-schema namespace="urn:test11" element-form-default="QUALIFIED"/>
<java-types>
<java-type xml-accessor-type="FIELD" name="Table1">
<xml-type namespace="urn:test11" name="table1Type"/>
<xml-root-element namespace="urn:test11" name="table1Type"/>
<java-attributes>
<xml-element xml-path="id/text()" type="java.lang.String" java-attribute="id">
<xml-null-policy is-set-performed-for-absent-node="true" null-representation-for-xml="XSI_NIL" empty-node-represents-null="false" xsi-nil-represents-null="true"/>
<xml-schema-type name="string"/>
</xml-element>
</java-attributes>
</java-type>
</java-types>
</xml-bindings>


11. package as new war deploy it to glassfish as below
./bin/asadmin deploy /home/halil/projects/eclipselink-workdir/fix-war/test11.war

12. test the web servie with soapui and got the below exceptions


13. now, currently, i am getting the below error


(Eclipse Persistence Services - 2.5.0.qualifier): org.eclipse.persistence.exceptions.SessionLoaderException
Exception Description: A META-INF/eclipselink-dbws-ox.xml was thrown while parsing the XML file against the XML schema.
Internal Exception: Exception (Eclipse Persistence Services - 2.5.0.qualifier): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http:// www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-bindings was not found in the project
at org.eclipse.persistence.exceptions.SessionLoaderException.failedToParseXML(SessionLoaderException.java:120)
at org.eclipse.persistence.internal.xr.XRSessionsFactory.loadProjectConfig(XRSessionsFactory.java:119)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.createSession(SessionsFactory.java:248)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildDatabaseSessionConfig(SessionsFactory.java:188)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildSession(SessionsFactory.java:177)
at org.eclipse.persistence.internal.sessions.factories.SessionsFactory.buildSessionConfigs(SessionsFactory.java:126)
at org.eclipse.persistence.internal.xr.XRSessionConfigLoader.load(XRSessionConfigLoader.java:44)
at org.eclipse.persistence.internal.xr.XRServiceFactory.buildSessions(XRServiceFactory.java:310)
at org.eclipse.persistence.internal.xr.XRServiceFactory.initializeService(XRServiceFactory.java:190)
at org.eclipse.persistence.internal.dbws.ProviderHelper.buildService(ProviderHelper.java:673)
at org.eclipse.persistence.internal.dbws.ProviderHelper.init(ProviderHelper.java:243)
at _dbws.DBWSProvider.init(DBWSProvider.java from JavaSourceFromString:47)

bla. bla. bla.

Caused by: Exception (Eclipse Persistence Services - 2.5.0.qualifier): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-bindings was not found in the project
at org.eclipse.persistence.exceptions.XMLMarshalException.noDescriptorWithMatchingRootElement(XMLMarshalException.java:146)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.getDescriptor(DOMUnmarshaller.java:413)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.xmlToObject(DOMUnmarshaller.java:432)
at org.eclipse.persistence.internal.oxm.record.DOMUnmarshaller.unmarshal(DOMUnmarshaller.java:334)
at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:464)
at org.eclipse.persistence.internal.xr.XRSessionsFactory.loadProjectConfig(XRSessionsFactory.java:110)
... 75 more
|#]

bla. bla. bla.



[#|2013-02-05T04:16:27.818-0500|SEVERE|glassfish3.1.2|com.sun.xml.ws.server.SyncProviderInvokerTube|_ThreadID=22;_ThreadName=Thread-2;|com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class _dbws.DBWSProvider
javax.xml.ws.WebServiceException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class _dbws.DBWSProvider
at org.glassfish.webservices.InstanceResolverImpl.resolve(InstanceResolverImpl.java:93)
at org.glassfish.webservices.InstanceResolverImpl$1.invokeProvider(InstanceResolverImpl.java:148)
at com.sun.xml.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:159)
at com.sun.xml.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:83)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)


bla. bla. bla.



Lastly, to be able to see the exceptions, i change the source code. I added below lines into the file ./dbws/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr/XRServiceFactory.java

aroung line 317.

for (String prefix : META_INF_PATHS) {
String searchPath = prefix + sessionsFile;
System.out.println("halil:"+searchPath);
XRSessionConfigLoader loader = new XRSessionConfigLoader(searchPath);
loader.setShouldLogin(false);
try {
found = loader.load(sessionManager, projectLoader);
} catch (RuntimeException e) { /* ignore */
e.printStackTrace();
}
if (found) {
break;
}
}






It seems that I need some xmlns decleration in the dbws-ox.xml file. But, i dont know. Could you please help me?



best,


-halil.
  • Attachment: test11.war
    (Size: 8.58KB, Downloaded 50 times)

[Updated on: Tue, 05 February 2013 04:43]

Report message to a moderator

Re: dbws utils generated war file gives error : _dbws.DBWSProvider is not available [message #1007374 is a reply to message #1007256] Tue, 05 February 2013 11:34 Go to previous message
David McCann is currently offline David McCann
Messages: 20
Registered: July 2009
Junior Member
It looks like the attempt to load the OXM metadata project is failing; when this occurs (meaning we can't load the OX project via JAXB metadata) we attempt to load the OX project via legacy deployment XML format (this is done to provide backwards compatibility). What I'd suggest is that you revert 'META-INF/eclipselink-dbws-ox.xml' to it's original format, then add some debug statements in the code that tries to load the OX project via dynamic JAXB to see how far it gets.

XRServiceFactory.loadOXMetadata(Classloader)

Note that his could also be caused by a mismatch in EclipseLink versions between your client code and the app server; if the client side is generating the OX project in JAXB metadata format but the server side code is expecting the legacy deployment XML format this will occur. Please make sure the same JAR versions are being used on the client and server.

--Dave
Previous Topic:@AttributeOverride ignored with @Embedded
Next Topic:Index on dynamic entities?
Goto Forum:
  


Current Time: Thu Aug 21 02:37:06 EDT 2014

Powered by FUDForum. Page generated in 0.01867 seconds