Unable to connect Cloud SQL mySql instance from Data Fusion. Exception "Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory" - google-cloud-sql

Facing exception "Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory' due to underlying exception."
when trying to connect with mysql instance in google cloud data fusion.
created cloud data fusion instance
From Wrangler-->Add connection --> Added the jar build(created from pom.xml given below) as a driver
In Add connection used the connection string as "dbc:mysql://google/mysql?cloudSqlInstance=socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false"
While Testing the connection, it throws error, "Could not create socket factory 'com.google.cloud.sql.mysql.SocketFactory' due to underlying exception."
This is my pom.xml and I build the fat jar using mvn package.
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>mysql-with-cloud-sql-socket-factory</artifactId>
<packaging>pom</packaging>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.13</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory-connector-j-8</artifactId>
<version>1.0.15</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration> <!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>jar-with-dependencies</id>
<properties>
<lane>jar-with-dependencies</lane>
</properties>
</profile>
</profiles>
</project>

Use MySQL instead:
From the Add Connection> Database Search for MySQL
Download the MySQL Driver from dev.mysql.com. Unzip.
On the hub again this time click Deploy Upload mysql-connector-java-5.x.xx-bin.jar
Go back to Add Connection> Database, you should see green tick against MySQL driver
Click on MySQL driver and setup the connection parameter.
Make sure you have added the relevant network in the Cloud SQL screen to allow Datafusion instance to make connection to Cloud SQL. If Datafusion is running in the same project then you dont need to do anything else.

Related

NetBeans Maven Project jar file not executing

For some reason when I clean and build my maven project in NetBeans, the resulting jar file does not execute when clicked. I've tried altering the pom file several times, here is what it looks like now:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>mainWindow.java</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>corp1</id>
<name>Corporate Repository</name>
<url>file:///EGR-1L11QD2/CLS_lab/fitbir_access_project</url>
<layout>default</layout>
</repository>
</distributionManagement>
<modelVersion>4.0.0</modelVersion>
<groupId>cls.lab</groupId>
<artifactId>fitbir_access</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.24</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
My application is connected to a MySQL database, I'm not sure if that has something to do with it.
Edit: Tried to run the following line in both Administrator: Windows PowerShell and Command Prompt, both with the same error "Could not find or load main class: mainWindow.java":
java -jar fitbir_access-1.0-SNAPSHOT-jar-with-dependencies.jar
Here is MANIFEST.MF Properties:
And here is what I get when I try to open MANIFEST.MF:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: audra
Build-Jdk: 16.0.1
Main-Class: mainWindow.java
Edit 2: Here is the file location for mainWindow.java: C:\Users\audra\OneDrive\Documents\NetBeansProjects\FITBIR\src\main\java\cls_lab\mainWindow.java
Compile classpath: C:\Users\audra.m2\repository\mysql\mysql-connector-java\8.0.24\mysql-connector-java-8.0.24.jar;C:\Users\audra.m2\repository\com\google\protobuf\protobuf-java\3.11.4\protobuf-java-3.11.4.jar;C:\Users\audra.m2\repository\com\h2database\h2\1.4.200\h2-1.4.200.jar;C:\Users\audra\OneDrive\Documents\NetBeansProjects\fitbir\target\classes
Runtime classpath: C:\Users\audra\OneDrive\Documents\NetBeansProjects\fitbir\target\classes;C:\Users\audra.m2\repository\mysql\mysql-connector-java\8.0.24\mysql-connector-java-8.0.24.jar;C:\Users\audra.m2\repository\com\google\protobuf\protobuf-java\3.11.4\protobuf-java-3.11.4.jar;C:\Users\audra.m2\repository\com\h2database\h2\1.4.200\h2-1.4.200.jar
And the boot classpath is like a page long so I won't post it unless it's necessary.
Edit 3: I changed the file locations so everything is under NetBeansProjects\fitbir (with lowercase letters), but this did not solve anything. I also changed the main class name in the pom file to cls_lab.mainWindow.java so that it is now the fully qualified class name, but I still have the same error when I run it through command prompt: Can not find or load main class.

Can't connect Cloud Data Fusion with Google Cloud SQL for PostgreSQL

My goal is to read data from Cloud SQL Postgres to BigQuery via a Cloud Data Fusion pipeline.
For this, I set up a Cloud Data Fusion instance and assigned the following two permissions to the service account: (see https://cloud.google.com/data-fusion/docs/how-to/create-instance#setting_up_permissions)
Cloud SQL Client
Cloud Data Fusion API Service Agent
As a next step I connected myself to the Cloud Data Fusion Instance, and navigated to Wrangler -> Add Connection -> Database -> Google Cloud SQL for PostgreSQL.
As the driver I uploaded the postgres-socket-factory-1.0.13-jar-with-dependencies.jar which I downloaded here: https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
For the driver configuration, I set:
Name: cloudsql-postgresql
Class name: org.postgresql.Driver
For the database connection, I set:
Connection name: <PROJECT_NAME>:<REGION>:<INSTANCE_CONNECTION_NAME>
Connection string: jdbc:postgresql://google/<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory
Username: Database username
Password: Database password
After clicking on Test Connection, I receive the org.postgresql.Driver error message.
Most likely you need a driver and the JDBC Socket Factory to get it to work properly. You should bundle the postgres connector with the socket factory into a uber-jar and see if that solves the problem.
Here is a quick (untested) pom that should accomplish this:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>postgres-with-cloud-sql-socket-factory</artifactId>
<packaging>pom</packaging>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>postgres-socket-factory</artifactId>
<version>1.0.13</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
#Sebastian Auberger,
We had the same issue, basically Data Fusion creates a Service Account which tries to create a IAP Tunnel to the Cloud SQL Instance. We could get through this issue by giving the role "Cloud SQL Client".
Give it a shot and let us know!.
On a related note, if the Data Fusion is private, then to reach the Cloud SQL instance through a private interface (no public IP traffic), you'll need a "Proxy VM", similar to what's described in this doc, but with a different startup-script, this blog post has a good overview on how to achieve this.

How to correctly manage feature configuration deployment in JBoss Fuse 6.2.1?

I am trying to evaluate JBoss Fuse as an integration platform, and I have the following question regarding deployment.
I am trying to set up a fabric and use profiles, more specifically feature repositories for camel/blueprint component deployment.
I am having the following issue with externalizing the component configuration: when i update the snapshot of the configuration file artifact, the configuration changes are not picked up by the container.
Moreover, when i completely remove the profile from the container, the PID config file stays on the server in etc/ folder.
Also there is an additional issue during deployment where the camel bundle gets activated before the config pid file is loaded, resulting in exception in aries blueprint, and i have to additionally refresh the osgi bundle manually.
Here is how the feature repository file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<features name="fuse-poc">
<feature name="fuse-poc-common" version="${project.version}">
<bundle>mvn:com.myorg.fuse/common/${project.version}</bundle>
</feature>
<feature name="fuse-poc-camel" version="${project.version}">
<feature>fuse-poc-common</feature>
<config name="com.myorg.fuse.poc.camel">
test.value=ENC(5XdDgfKwwhMTmbo1z874eQ==)
</config>
<bundle>mvn:com.myorg.fuse/fuse-poc-camel/${project.version} </bundle>
</feature>
<feature name="fuse-poc-activemq" version="${project.version}">
<feature>fuse-poc-common</feature>
<configfile finalname="etc/com.myorg.fuse.poc.jms.cfg">
mvn:com.myorg.fuse/feature/${project.version}/cfg/dev
</configfile>
<bundle>mvn:com.myorg.fuse/fuse-poc-camel- activemq/${project.version}</bundle>
</feature>
</features>
The projects themselves are simple camel archetype projects with one having a basic route with logging and one with route using activemq and cm:property-placeholder in blueprint.xml
Here is the corresponding build section in maven:
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.myorg.fuse</groupId>
<artifactId>fuse-poc-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>feature</artifactId>
<packaging>pom</packaging>
<name>FUSE PoC Feature Repository</name>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>filter</id>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/classes/fuse-poc.xml</file>
<type>xml</type>
<classifier>features</classifier>
</artifact>
<artifact>
<file>src/main/resources/env/dev/com.myorg.fuse.poc.jms.cfg</file>
<type>cfg</type>
<classifier>dev</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here are the commands I use to deploy the feature:
fabric:version-create 1.1
fabric:profile-create --parent jboss-fuse-full fuse-poc
fabric:profile-edit --repository mvn:com.myorg.fuse/feature/1.0.0-SNAPSHOT/xml/features fuse-poc 1.1
fabric:profile-edit --feature fuse-poc-camel fuse-poc 1.1
fabric:profile-edit --feature fuse-poc-activemq fuse-poc 1.1
fabric:container-upgrade 1.1 root
fabric:container-add-profile root fuse-poc
After I manually do osgi:refresh <bundle id> the bundle it starts fine.
fabric:container-remove-profile root fuse-poc
All the config pid entries stay in the config, and all osgi bundles are also staying installed. How do i correctly undeploy artifacts so that the container is clean and an updated version of the same artifact can be deployed without side effects?
I suspect i am doing something conceptually wrong, because ultimately the issue above leads to the following problem: if i add a property to either the element in features, or the .cfg file and install the project using maven again, and then do container-remove-profile, profile-refresh, and container-add-profile, the config does not change at all. It can only be redeployed correctly if i manually do the config:delete command on my pid in the console.
So I finally had time to dig through the sources and cross-reference karaf, fabric and jboss documentation.
Here is how it works:
The code responsible for loading/unloading bundles through the feature repository system is located in fabric-agent-1.2.0.redhat-621084.jar
Notably, the class io.fabric8.agent.service.FeatureConfigInstaller is responsible for the configuration entries, and the class io.fabric8.agent.service.Agent is doing the overall deployment
There is no code at all to uninstall the config file/remove config entries. This makes it troublesome to do development with SNAPSHOTs
However, there is a useful 'override' property that can be specified on the <configfile> element - if it is set to true, the config PID file will be overwritten on deployment which is exactly what i wanted for local development
For <config> element, there is an undocumented 'append' property, which, when set to true, is supposed to append new entries to the config. However, it is hilariously bugged - turns out it also removes all defined previously existing properties when trying to append. Conclusion - use <configfile> functionality instead
Additionally, for externalizing environment configuration i've come to the conclusion the most simple way is to produce multiple feature xml descriptors from the same file through different maven build profiles. The project files consequently look like this:
pom.xml:
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.myorg.fuse</groupId>
<artifactId>fuse-poc-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>feature</artifactId>
<packaging>pom</packaging>
<name>FUSE PoC Feature Repository</name>
<properties>
<build.environment>dev</build.environment>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>filter</id>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/classes/fuse-poc.xml</file>
<type>xml</type>
<classifier>features-${build.environment}</classifier>
</artifact>
<artifact>
<file>src/main/resources/env/${build.environment}/com.myorg.fuse.poc.cfg</file>
<type>cfg</type>
<classifier>${build.environment}</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>local</id>
<properties>
<build.environment>local-dev</build.environment>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<build.environment>dev</build.environment>
</properties>
</profile>
<profile>
<id>uat</id>
<properties>
<build.environment>uat</build.environment>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<build.environment>prod</build.environment>
</properties>
</profile>
</profiles>
</project>
feature.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features name="fuse-poc">
<feature name="fuse-poc-common" version="${project.version}">
<bundle>mvn:com.myorg.fuse/common/${project.version}</bundle>
</feature>
<feature name="fuse-poc-camel" version="${project.version}">
<feature>fuse-poc-common</feature>
<configfile finalname="etc/com.myorg.fuse.poc.cfg" override="true">
mvn:com.myorg.fuse/feature/${project.version}/cfg/${build.environment}
</configfile>
<bundle>mvn:com.myorg.fuse/fuse-poc-camel/${project.version}</bundle>
</feature>
</features>
This way you can directly specify the environment when creating the profile for deploying the feature:
fabric:profile-create --parent jboss-fuse-full fuse-poc fabric:profile-edit --repository mvn:com.myorg.fuse/feature/1.0.0-SNAPSHOT/xml/features-local-dev fuse-poc
Note to set up the build integration tool to build the feature module for all profiles except 'local-dev', since that one needs to be used by developers locally and should not be downloaded from the central repository
On a final note, once i resolved the config handling issues and the bundles started deploying correctly, the platform also started undeploying bundles correctly on removing the profile from the container. I suspect there is some issue with uninstalling the bundles whenever the original deployment ended in failure

Deploy a JAR file in Cloudbees - 502 Bad Gateway

I am trying to deploy the simplest application on Cloudbees, using the Spark Java framework. This produces a Jar file that I tried to deploy through the Jenkins push->deploy, but it warns me that the deploy plugin cannot deploy a jar file...
Whatever, I deployed my jar through the CloudBees SDK and the CLI :
bees app:deploy -t java -R java_version=1.7 target\myapp-with-dependencies.jar
And then it tells me that the application has been deployed to my URL. But when I try to reach this URL, I get a 502 Bad Gateway Error...
However, whether if run my main class through IntelliJ or with the Jar file produced by maven, the URL 127.0.0.1:8080 returns me the expected Hello Spark.
Here is my main class :
public class HelloSpark {
public static void main(String[] args) {
String port = System.getProperty("app.port","8080");
//So that the port is the one used by CloudBees
Spark.setPort(Integer.parseInt(port));
Spark.get(new Route("/") {
#Override
public Object handle(Request request, Response response) {
return "Hello Spark";
}
});
}
}
And here is my pom file :
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spark-from-scratch</groupId>
<artifactId>spark-from-scratch</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>spark</groupId>
<artifactId>spark</artifactId>
<version>0.9.9.4-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>HelloSpark</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I think you need to specify your main class in this way:
bees app:deploy -t java -R class=your.main.Class -R java_version=1.7 PATH_TO_APP_PACKAGE
I think it's necessary to specify it in your command, you can read more here:
https://developer.cloudbees.com/bin/view/RUN/Java+Container

Eclipse with Websphere 7.0.0.17: EJB project does not work with resources within the workspace, but works with resources on Server

My application works with Maven and has three modules:
ear-module
web-module
ejb-module
EJB Version is 3.0.
Deployment works in both ways without error messages.
When I try to run the application with the Publishing settings for Websphere "Run server with resources on Server" it works fine.
When I try do the same with "Run server with resources within the workspace" and open the application in my Browser it fails with this error message:
A resource reference binding could not be found for the following resource references [jdbc/nust], defined for the NustService component.
I am new in JEE5, but it seems to me that local the websphere cant find the ejb-jar.xml.
Here the pom for ejb modul:
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>mycomp-nust-frontend-app</artifactId>
<groupId>mycomp.app</groupId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>mycomp-nust-frontend-svc</artifactId>
<name>mycomp-nust-frontend-svc</name>
<packaging>ejb</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mycomp.service</groupId>
<artifactId>mycomp-service-utils</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<!-- Add classpath container for Websphere Application Server 7 to the
Eclipse project. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<classpathContainers>
<classpathContainer>org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v70/was.base.v7</classpathContainer>
<classpathContainer>org.eclipse.jst.j2ee.internal.module.container</classpathContainer>
</classpathContainers>
<projectNameTemplate>${project.name}</projectNameTemplate>
</configuration>
</plugin>
</plugins>
</build>
</project>
Any suggestions, more info needed?
thx
The problem is not with your ejb-jar.xml. Remember, the ejb-jar.xml just declares references; the actual binding to a "real" resource is done by application server-specific files. In WebSphere's case, this file is ibm-ejb-jar-bnd.xml, which should be located at the same directory as ejb-jar.xml. Do you happen to have that file there?
I faced a similar situation where my application's defined resources could not be found. The solution was to define the /WEB-INF/ibm-web-bnd.xmi
<?xml version="1.0" encoding="UTF-8"?>
<com.ibm.ejs.models.base.bindings.webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:com.ibm.ejs.models.base.bindings.webappbnd="webappbnd.xmi" xmi:id="WebAppBinding_1348167502046" virtualHostName="default_host">
<webapp href="WEB-INF/web.xml#struts_blank"/>
<resRefBindings jndiName="jms/MyConnectionFactory" xmi:id="cf">
<bindingResourceRef href="WEB-INF/web.xml"/>
</resRefBindings>
<messageDestinationRefBindings jndiName="jms/TopicSpace/Group/Test" xmi:id="myTopic">
<bindingMessageDestinationRef href="WEB-INF/web.xml"/>
</messageDestinationRefBindings>
</com.ibm.ejs.models.base.bindings.webappbnd:WebAppBinding>
A senior developer in the team said that this should be a XML file but then that didn't work. I discovered this by exporting a deployed application from an IBM tutorial. Depending on your application you will have to change the above resource references.
Hope this helps