IDEMPIERE-5903 support multiple webservice project (#2084)

* IDEMPIERE-5903:support multi webservice project (issue 1:There is an endpoint already running on/rest)

https://stackoverflow.com/a/49553239/4037367

* IDEMPIERE-5903:support multi webservice project (reuse resource)

* IDEMPIERE-5903:support multi webservice project (fix comment review)
This commit is contained in:
hieplq 2023-11-04 19:09:27 +07:00 committed by GitHub
parent 23b738df5b
commit d217eb531e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 197 additions and 49 deletions

View File

@ -25,6 +25,7 @@ FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c
@Set VMOPTS=%VMOPTS% -Djetty.home=jettyhome @Set VMOPTS=%VMOPTS% -Djetty.home=jettyhome
@Set VMOPTS=%VMOPTS% -Djetty.base=jettyhome @Set VMOPTS=%VMOPTS% -Djetty.base=jettyhome
@Set VMOPTS=%VMOPTS% -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml @Set VMOPTS=%VMOPTS% -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml
@Set VMOPTS=%VMOPTS% -Dorg.apache.cxf.osgi.http.transport.disable=true
@Set VMOPTS=%VMOPTS% -Dosgi.console=localhost:12612 @Set VMOPTS=%VMOPTS% -Dosgi.console=localhost:12612
@Set VMOPTS=%VMOPTS% -Dmail.mime.encodefilename=true @Set VMOPTS=%VMOPTS% -Dmail.mime.encodefilename=true
@Set VMOPTS=%VMOPTS% -Dmail.mime.decodefilename=true @Set VMOPTS=%VMOPTS% -Dmail.mime.decodefilename=true

View File

@ -31,6 +31,7 @@ VMOPTS="-Dorg.osgi.framework.bootdelegation=sun.security.ssl
-Djetty.home=$BASE/jettyhome -Djetty.home=$BASE/jettyhome
-Djetty.base=$BASE/jettyhome -Djetty.base=$BASE/jettyhome
-Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml
-Dorg.apache.cxf.osgi.http.transport.disable=true
-Dosgi.console=$HOST:$TELNET_PORT -Dosgi.console=$HOST:$TELNET_PORT
-Dmail.mime.encodefilename=true -Dmail.mime.encodefilename=true
-Dmail.mime.decodefilename=true -Dmail.mime.decodefilename=true

View File

@ -9,7 +9,7 @@
<launcherArgs> <launcherArgs>
<programArgs>-console <programArgs>-console
</programArgs> </programArgs>
<vmArgs>--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml <vmArgs>--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml -Dorg.apache.cxf.osgi.http.transport.disable=true
</vmArgs> </vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac> </vmArgsMac>

View File

@ -441,6 +441,7 @@
<setEntry value="org.idempiere.keikai@default:false"/> <setEntry value="org.idempiere.keikai@default:false"/>
<setEntry value="org.idempiere.printformat.editor@default:default"/> <setEntry value="org.idempiere.printformat.editor@default:default"/>
<setEntry value="org.idempiere.webservices@default:default"/> <setEntry value="org.idempiere.webservices@default:default"/>
<setEntry value="org.idempiere.webservices.resources@default:default"/>
<setEntry value="org.idempiere.zk.billboard.chart@default:default"/> <setEntry value="org.idempiere.zk.billboard.chart@default:default"/>
<setEntry value="org.idempiere.zk.billboard@default:false"/> <setEntry value="org.idempiere.zk.billboard@default:false"/>
<setEntry value="org.idempiere.zk.extra@default:default"/> <setEntry value="org.idempiere.zk.extra@default:default"/>

View File

@ -53,7 +53,7 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true --add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true --add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml -Dorg.apache.cxf.osgi.http.transport.disable=true"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:org.adempiere.base}/.."/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:org.adempiere.base}/.."/>
<stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.adempiere.server.server_product"/> <stringAttribute key="product" value="org.adempiere.server.server_product"/>
@ -441,6 +441,7 @@
<setEntry value="org.idempiere.keikai@default:false"/> <setEntry value="org.idempiere.keikai@default:false"/>
<setEntry value="org.idempiere.printformat.editor@default:default"/> <setEntry value="org.idempiere.printformat.editor@default:default"/>
<setEntry value="org.idempiere.ui.sso.oidc@default:default"/> <setEntry value="org.idempiere.ui.sso.oidc@default:default"/>
<setEntry value="org.idempiere.webservices.resources@default:default"/>
<setEntry value="org.idempiere.webservices@default:default"/> <setEntry value="org.idempiere.webservices@default:default"/>
<setEntry value="org.idempiere.zk.billboard.chart@default:default"/> <setEntry value="org.idempiere.zk.billboard.chart@default:default"/>
<setEntry value="org.idempiere.zk.billboard@default:false"/> <setEntry value="org.idempiere.zk.billboard@default:false"/>

View File

@ -24,6 +24,7 @@ jars.extra.classpath = platform:/plugin/org.adempiere.base/,\
platform:/plugin/org.idempiere.felix.webconsole/,\ platform:/plugin/org.idempiere.felix.webconsole/,\
platform:/plugin/org.idempiere.hazelcast.service/,\ platform:/plugin/org.idempiere.hazelcast.service/,\
platform:/plugin/org.idempiere.webservices/,\ platform:/plugin/org.idempiere.webservices/,\
platform:/plugin/org.idempiere.webservices.resources/,\
platform:/plugin/org.idempiere.zk.extra/,\ platform:/plugin/org.idempiere.zk.extra/,\
platform:/plugin/org.idempiere.keikai,\ platform:/plugin/org.idempiere.keikai,\
platform:/plugin/org.idempiere.printformat.editor,\ platform:/plugin/org.idempiere.printformat.editor,\

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?pde version="3.5"?>
<product name="iDempiere Server" uid="org.adempiere.server.product" id="org.adempiere.server.server_product" application="org.adempiere.server.application" version="11.0.0.qualifier" useFeatures="true" includeLaunchers="true" autoIncludeRequirements="false"> <product name="iDempiere Server" uid="org.adempiere.server.product" id="org.adempiere.server.server_product" application="org.adempiere.server.application" version="11.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>
@ -9,7 +9,7 @@
<launcherArgs> <launcherArgs>
<programArgs>-console <programArgs>-console
</programArgs> </programArgs>
<vmArgs>--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml <vmArgs>--add-modules=java.se --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.sql.rowset/com.sun.rowset=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Declipse.product=org.adempiere.server.product -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -Dorg.osgi.framework.bootdelegation=sun.security.ssl -Dosgi.compatibility.bootdelegation=true -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-deployer.xml,etc/jetty-ssl.xml,etc/jetty-ssl-context.xml,etc/jetty-http.xml,etc/jetty-https.xml,etc/jetty-threadpool.xml,etc/jetty-http-forwarded.xml -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -Dhazelcast.config=hazelcast.xml -Dorg.apache.cxf.osgi.http.transport.disable=true
</vmArgs> </vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac> </vmArgsMac>
@ -61,15 +61,15 @@
<plugin id="org.idempiere.felix.webconsole" autoStart="true" startLevel="0" /> <plugin id="org.idempiere.felix.webconsole" autoStart="true" startLevel="0" />
<plugin id="org.mortbay.jasper.apache-el" autoStart="true" startLevel="0" /> <plugin id="org.mortbay.jasper.apache-el" autoStart="true" startLevel="0" />
<plugin id="org.mortbay.jasper.apache-jsp" autoStart="true" startLevel="0" /> <plugin id="org.mortbay.jasper.apache-jsp" autoStart="true" startLevel="0" />
<property name="osgi.instance.area.default" value="@config.dir/../workspace" />
<property name="eclipse.product" value="org.adempiere.server.product" />
<property name="osgi.checkConfiguration" value="true" />
<property name="osgi.console.enable.builtin" value="false" />
<property name="osgi.compatibility.bootdelegation" value="true" />
<property name="org.eclipse.equinox.simpleconfigurator.exclusiveInstallation" value="false" />
<property name="osgi.framework.activeThreadType" value="normal" /> <property name="osgi.framework.activeThreadType" value="normal" />
<property name="org.eclipse.update.reconcile" value="false" /> <property name="osgi.instance.area.default" value="@config.dir/../workspace" />
<property name="osgi.checkConfiguration" value="true" />
<property name="osgi.noShutdown" value="true" /> <property name="osgi.noShutdown" value="true" />
<property name="org.eclipse.equinox.simpleconfigurator.exclusiveInstallation" value="false" />
<property name="osgi.compatibility.bootdelegation" value="true" />
<property name="org.eclipse.update.reconcile" value="false" />
<property name="eclipse.product" value="org.adempiere.server.product" />
<property name="osgi.console.enable.builtin" value="false" />
</configurations> </configurations>
<preferencesInfo> <preferencesInfo>

View File

@ -419,6 +419,7 @@
<setEntry value="org.idempiere.hazelcast.service@default:default"/> <setEntry value="org.idempiere.hazelcast.service@default:default"/>
<setEntry value="org.idempiere.test@default:default"/> <setEntry value="org.idempiere.test@default:default"/>
<setEntry value="org.idempiere.webservices@default:default"/> <setEntry value="org.idempiere.webservices@default:default"/>
<setEntry value="org.idempiere.webservices.resources@default:default"/>
<setEntry value="org.idempiere.zk.billboard.chart@default:default"/> <setEntry value="org.idempiere.zk.billboard.chart@default:default"/>
<setEntry value="org.idempiere.zk.billboard@default:default"/> <setEntry value="org.idempiere.zk.billboard@default:default"/>
<setEntry value="org.idempiere.zk.extra@default:default"/> <setEntry value="org.idempiere.zk.extra@default:default"/>

View File

@ -255,7 +255,7 @@
<setEntry value="org.eclipse.equinox.servletbridge@default:default"/> <setEntry value="org.eclipse.equinox.servletbridge@default:default"/>
<setEntry value="org.eclipse.equinox.simpleconfigurator.manipulator@default:default"/> <setEntry value="org.eclipse.equinox.simpleconfigurator.manipulator@default:default"/>
<setEntry value="org.eclipse.equinox.simpleconfigurator@1:true"/> <setEntry value="org.eclipse.equinox.simpleconfigurator@1:true"/>
<setEntry value="org.eclipse.jdt.core.compiler.batch*3.33.0.v20230218-1114@default:default"/> <setEntry value="org.eclipse.jdt.core.compiler.batch@default:default"/>
<setEntry value="org.eclipse.jdt.core@default:default"/> <setEntry value="org.eclipse.jdt.core@default:default"/>
<setEntry value="org.eclipse.jdt.junit.runtime@default:default"/> <setEntry value="org.eclipse.jdt.junit.runtime@default:default"/>
<setEntry value="org.eclipse.jdt.junit5.runtime@default:default"/> <setEntry value="org.eclipse.jdt.junit5.runtime@default:default"/>
@ -419,6 +419,7 @@
<setEntry value="org.idempiere.hazelcast.service@default:default"/> <setEntry value="org.idempiere.hazelcast.service@default:default"/>
<setEntry value="org.idempiere.test@default:default"/> <setEntry value="org.idempiere.test@default:default"/>
<setEntry value="org.idempiere.webservices@default:default"/> <setEntry value="org.idempiere.webservices@default:default"/>
<setEntry value="org.idempiere.webservices.resources@default:default"/>
<setEntry value="org.idempiere.zk.billboard.chart@default:default"/> <setEntry value="org.idempiere.zk.billboard.chart@default:default"/>
<setEntry value="org.idempiere.zk.billboard@default:default"/> <setEntry value="org.idempiere.zk.billboard@default:default"/>
<setEntry value="org.idempiere.zk.extra@default:default"/> <setEntry value="org.idempiere.zk.extra@default:default"/>

View File

@ -346,4 +346,11 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="org.idempiere.webservices.resources"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature> </feature>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.idempiere.webservices.resources</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
pluginProject.equinox=false
pluginProject.extensions=false
resolve.requirebundle=false

View File

@ -0,0 +1,25 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Web Services Helper Resource Lookup
Bundle-SymbolicName: org.idempiere.webservices.resources;singleton:=true
Bundle-Version: 11.0.0.qualifier
Export-Package: META-INF.cxf,
org.idempiere.webservices.resources,
schemas,
schemas.configuration
Import-Package: javax.servlet;version="4.0.0",
org.compiere.util,
org.eclipse.jetty.osgi.boot;version="10.0.9",
org.eclipse.jetty.server.handler;version="10.0.9",
org.eclipse.jetty.servlet;version="10.0.9",
org.eclipse.jetty.util;version="10.0.9",
org.eclipse.jetty.webapp;version="10.0.9",
org.osgi.framework;version="1.10.0",
org.osgi.framework.wiring;version="1.2.0",
org.springframework.web.context;version="5.2.22.RELEASE"
Bundle-Vendor: Idempiere
Automatic-Module-Name: org.idempiere.webservices.resources
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=17))"

View File

@ -0,0 +1,4 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.

View File

@ -0,0 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>org.idempiere.webservices.resources</artifactId>
<parent>
<groupId>org.idempiere</groupId>
<artifactId>org.idempiere.parent</artifactId>
<version>${revision}</version>
<relativePath>../org.idempiere.parent/pom.xml</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>
<name>Web Services Helper Resource Lookup</name>
<description>Bundle to provide resources for cfx and spring"</description>
</project>

View File

@ -0,0 +1,68 @@
/******************************************************************************
* Copyright (C) 2012 Trek Global *
* Product: iDempiere ERP & CRM Smart Business Solution *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program 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 General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.idempiere.webservices.resources;
import javax.servlet.ServletContextEvent;
import org.compiere.util.CLogger;
import org.eclipse.jetty.osgi.boot.OSGiWebappConstants;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.osgi.framework.BundleContext;
import org.osgi.framework.wiring.BundleWiring;
/**
* @author hengsin
*
*
*/
public class ContextLoaderListener extends
org.springframework.web.context.ContextLoaderListener {
private static final CLogger log = CLogger.getCLogger(ContextLoaderListener.class);
/**
*
*/
public ContextLoaderListener() {
}
@Override
public void contextInitialized(ServletContextEvent event) {
Object bundleContextObj = null;
if (event.getSource() != null && event.getSource() instanceof ContextHandler.StaticContext) {
ContextHandler.StaticContext staticContext = (ContextHandler.StaticContext)event.getSource();
bundleContextObj = staticContext.getAttribute(OSGiWebappConstants.OSGI_BUNDLECONTEXT);
}
// get ClassLoader of web app is loading
ClassLoader webappBundleCl = null;
if (bundleContextObj != null && bundleContextObj instanceof BundleContext) {
BundleContext webappBundleContext = (BundleContext)bundleContextObj;
webappBundleCl = webappBundleContext.getBundle().adapt(BundleWiring.class).getClassLoader();
}
// set ClassLoader to load schema also
if (webappBundleCl != null) {
ClassLoader currentCl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(webappBundleCl);
super.contextInitialized(event);
} finally {
Thread.currentThread().setContextClassLoader(currentCl);
}
}else {
log.warning("can't findout ClassLoader for web service:" + event.getServletContext().getContextPath());
}
}
}

View File

@ -108,7 +108,8 @@ Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
wrapped.org.springframework.spring-web;bundle-version="5.2.15", wrapped.org.springframework.spring-web;bundle-version="5.2.15",
org.codehaus.jettison.jettison;bundle-version="1.4.1", org.codehaus.jettison.jettison;bundle-version="1.4.1",
org.eclipse.osgi, org.eclipse.osgi,
jakarta.annotation-api;bundle-version="1.3.5" jakarta.annotation-api;bundle-version="1.3.5",
org.idempiere.webservices.resources;bundle-version="11.0.0"
Bundle-ClassPath: ., Bundle-ClassPath: .,
lib/idempiere-xmlbeans.jar lib/idempiere-xmlbeans.jar
Export-Package: org.idempiere.webservices.model, Export-Package: org.idempiere.webservices.model,

View File

@ -1,32 +0,0 @@
/**
*
*/
package com.trekglobal.ws;
import javax.servlet.ServletContextEvent;
/**
* @author hengsin
*
*/
public class ContextLoaderListener extends
org.springframework.web.context.ContextLoaderListener {
/**
*
*/
public ContextLoaderListener() {
}
@Override
public void contextInitialized(ServletContextEvent event) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
super.contextInitialized(event);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
}
}

View File

@ -6,14 +6,13 @@
<context-param> <context-param>
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value> <param-value>
classpath:/META-INF/cxf/services.xml classpath:/org/idempiere/webservices/xml/services.xml
classpath:/META-INF/cxf/rest-context.xml classpath:/org/idempiere/webservices/xml/rest-context.xml
</param-value> </param-value>
</context-param> </context-param>
<listener> <listener>
<listener-class> <listener-class>
com.trekglobal.ws.ContextLoaderListener org.idempiere.webservices.resources.ContextLoaderListener
</listener-class> </listener-class>
</listener> </listener>

View File

@ -34,6 +34,7 @@
<module>org.idempiere.felix.webconsole</module> <module>org.idempiere.felix.webconsole</module>
<module>org.idempiere.hazelcast.service</module> <module>org.idempiere.hazelcast.service</module>
<module>org.idempiere.webservices</module> <module>org.idempiere.webservices</module>
<module>org.idempiere.webservices.resources</module>
<module>org.idempiere.webservices-feature</module> <module>org.idempiere.webservices-feature</module>
<module>org.idempiere.zk.extra</module> <module>org.idempiere.zk.extra</module>
<module>org.idempiere.keikai</module> <module>org.idempiere.keikai</module>