powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / JDBC в Jboss Developer Studio
3 сообщений из 3, страница 1 из 1
JDBC в Jboss Developer Studio
    #39504966
Zzzadruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Всем привет. Уже пару дней не могу настроить банальной подключение к базе данных MS SQL в Jboss Developer Studio. Работаю в перспективе Fuse Integration. Итак, что есть: xml файл, который должен быть разобран и отправлен в базу, и, собственно, сама база.
Код blueprint<blueprint xmlns=" http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<!--
The namespace for the camelContext element in Blueprint is 'https://camel.apache.org/schema/blueprint'. Additionally,
we can also define namespace prefixes we want to use them in the XPath expressions in our CBR.

While it is not required to assign id's to the <camelContext/> and <route/> elements, it is a good idea
to set those for runtime management purposes (logging, JMX MBeans, ...) -->
<bean class="org.apache.commons.dbcp.BasicDataSource" id="dataSource">
<property name="url" value="jdbc:sqlserver://10.0.1.****:1433;databaseName=Test;"/>
<property name="username" value="******"/>
<property name="password" value="******"/>
</bean>
<camelContext id="_context1" xmlns=" http://camel.apache.org/schema/blueprint">
<route id="_route1">
<from id="_from_xml" uri="file:src/xml?noop=true"/>
<log id="_log4" message="File read"/>
<setHeader headerName="code" id="_setHeader1">
<xpath>goods/good/code/text()</xpath>
</setHeader>
<setHeader headerName="name" id="_setHeader2">
<xpath>goods/good/name/text()</xpath>
</setHeader>
<setHeader headerName="Act" id="_setHeader3">
<constant>0</constant>
</setHeader>
<setBody id="_setBody1">
<sql>INSERT INTO SA_GOOD Values(${header.code}, ${header.name}, ${header.act})</sql>
</setBody>
<to id="_to1" uri="jdbc:dataSource"/>
<log id="_log1" message="Done!"/>
</route>
</camelContext>
</blueprint>

Лог ошибки[INFO] Starting Camel ...
[mel.test.blueprint.Main.main()] Activator INFO Camel activator starting
[mel.test.blueprint.Main.main()] Activator INFO Camel activator started
[ Blueprint Extender: 1] BlueprintContainerImpl INFO Bundle xml-to-database/1.0.0.SNAPSHOT is waiting for namespace handlers [ http://camel.apache.org/schema/blueprint%5D]http://camel.apache.org/schema/blueprint]
[ Blueprint Extender: 3] BlueprintCamelContext INFO Apache Camel 2.17.0.redhat-630254 (CamelContext: _context1) is starting
[ Blueprint Extender: 3] ManagedManagementStrategy INFO JMX is enabled
[ Blueprint Extender: 3] DefaultManagementAgent INFO ManagementAgent detected JVM system properties: {org.apache.camel.jmx.createRmiConnector=true}
[mi://pc00021:1099/jmxrmi/camel] DefaultManagementAgent INFO JMX Connector thread started and listening at: service:jmx:rmi:///jndi/rmi://pc00021:1099/jmxrmi/camel
[ Blueprint Extender: 3] DefaultRuntimeEndpointRegistry INFO Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
[ Blueprint Extender: 3] BlueprintCamelContext INFO Apache Camel 2.17.0.redhat-630254 (CamelContext: _context1) is shutting down
[ Blueprint Extender: 3] BlueprintCamelContext INFO Apache Camel 2.17.0.redhat-630254 (CamelContext: _context1) uptime 0.532 seconds
[ Blueprint Extender: 3] BlueprintCamelContext INFO Apache Camel 2.17.0.redhat-630254 (CamelContext: _context1) is shutdown in 0.000 seconds
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN Test bundle headers: Bundle-ManifestVersion=2, Bundle-Name=System Bundle, Bundle-SymbolicName=org.apache.felix.connect, Bundle-Vendor=Apache Software Foundation, Bundle-Version=0.0.0
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.cm [30], symbolicName: org.apache.aries.blueprint.cm
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.framework.hooks.bundle.EventHook], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.cm [30], symbolicName: org.apache.aries.blueprint.cm
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.startlevel.StartLevel], bundle: org.apache.felix.connect [0], symbolicName: org.apache.felix.connect
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-jdbc [17], symbolicName: org.apache.camel.camel-jdbc
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintListener], bundle: xml-to-database [2], symbolicName: xml-to-database
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-josql [14], symbolicName: org.apache.camel.camel-josql
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.proxy.ProxyManager], bundle: org.apache.aries.proxy.impl [25], symbolicName: org.apache.aries.proxy.impl
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.DataFormatResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.services.ParserService], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.url.URLStreamHandlerService], bundle: org.apache.felix.fileinstall [39], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationAdmin], bundle: org.apache.felix.configadmin [27], symbolicName: org.apache.felix.configadmin
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationListener, org.apache.felix.fileinstall.ArtifactListener, org.apache.felix.fileinstall.ArtifactInstaller], bundle: org.apache.felix.fileinstall [39], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.quiesce.participant.QuiesceParticipant], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.camel.camel-blueprint [8], symbolicName: org.apache.camel.camel-blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.cm [30], symbolicName: org.apache.aries.blueprint.cm
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: xml-to-database [2], symbolicName: xml-to-database
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.felix.cm.PersistenceManager], bundle: org.apache.felix.configadmin [27], symbolicName: org.apache.felix.configadmin
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.services.BlueprintExtenderService], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.cm [30], symbolicName: org.apache.aries.blueprint.cm
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ManagedServiceFactory], bundle: org.apache.felix.fileinstall [39], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.aries.blueprint.cm [30], symbolicName: org.apache.aries.blueprint.cm
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.packageadmin.PackageAdmin], bundle: org.apache.felix.connect [0], symbolicName: org.apache.felix.connect
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.camel.camel-blueprint [8], symbolicName: org.apache.camel.camel-blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint.core [28], symbolicName: org.apache.aries.blueprint.core
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.aries.blueprint.cm/1.0.6
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle xml-to-database/1.0.0.SNAPSHOT
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.aries.blueprint.core/1.4.4
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.camel.camel-blueprint/2.17.0.redhat-630254
[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopping
[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopped
[mel.test.blueprint.Main.main()] CamelBlueprintHelper INFO Deleting work directory target/bundles/1502708357225
[ERROR] *************************************
[ERROR] Error occurred while running main from: org.apache.camel.test.blueprint.Main
[ERROR]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:458)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext)
at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:295)
at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:256)
at org.apache.camel.test.blueprint.Main.doStart(Main.java:110)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:138)
at org.apache.camel.main.MainSupport.run(MainSupport.java:390)
at org.apache.camel.test.blueprint.Main.main(Main.java:79)
... 6 more
[ERROR] *************************************
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2017-08-14T14:00:17+03:00
[INFO] Final Memory: 39M/498M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.17.0.redhat-630254:run (default-cli) on project camel-blueprint: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

При том что в перспективе Database Development я спокойно могу подключиться к бд
...
Рейтинг: 0 / 0
JDBC в Jboss Developer Studio
    #39504968
Фотография Blazkowicz
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
https://stackoverflow.com/a/23998619
Ошибка к подключению к БД отношения не имеет. По-моему выбор инструментов какой-то предельно не удачный.
...
Рейтинг: 0 / 0
JDBC в Jboss Developer Studio
    #39520329
Zzzadruga
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Если что, проблема была в этой строчке
Код: sql
1.
<sql>INSERT INTO SA_GOOD VALUES(${header.code}, ${header.name}, ${header.act})</sql>



Необходимо использовать язык simple

Код: sql
1.
<simple>INSERT INTO SA_GOOD VALUES('${header.code}', '${header.name}', '${header.act}')</simple>
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / JDBC в Jboss Developer Studio
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]