[Embedded JBoss Development] - Re: ShrinkWrap - Descriptors
by aslak
"epbernard" wrote : Another remark is that you can't compose multiple time
| (also I dont' understand why you have so many classes liek descriptor container, asserts etc)
|
You can and will be able to compose multiple times, it just not implemented at the moment..
The reason for all the different Containers is that the different Archive extensions like WebArchive and EnterpriseArchive all consist of types of Containers but not necessarily the same. ie, a WebArchive is a MetadataContainer + a ResourceContainer + a ClassContainer, while a EnterpriseArchive is a MetadataContainer + a ResourceContainer but does not support the ClassContainer..
A Asset is more or less just a internal abstraction over how to get/open the Stream of data to be stored at a specific path.
The Descriptor name just came in now, because i made it on the 'outside', this could in theory be a part of the WebContainer interface.
They all 'share' the same base Archive impl as a backing, so there is no problem having code like this:
| WebArchive war = new WebArchiveImpl(new MemoryMapArchiveImpl());
| EnterpriseArchive ear = new EnterpriseArchiveImpl(war.getInternalArchive());
|
or
| EnterpriseArchive ear = new EnterpriseArchiveImpl(new MemoryMapArchiveImpl());
| WebArchive war = ear.getWebModule("my.war");
|
This should of course be hidden away in some 'specializes' like api, but the point is the same.
The 'external' user api is still not 100%, that's why you see new WebArchiveImpl(new MemoryMapArchiveImpl()) etc.. :)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257370#4257370
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257370
15 years, 3 months
[Embedded JBoss Development] - Re: ShrinkWrap - Descriptors
by epbernard
Another remark is that you can't compose multiple time
(also I dont' understand why you have so many classes liek descriptor container, asserts etc)
Could not you have something like
Archive archive = ...;
| WebArchive webArchive =
| archive.specializes(WebArchive.class)
| .setDisplayName("test-app")
| .addContextParameter("test", "yes")
| .addServlet(this.getClass(), "*.jsp")
| .addClass(IOUtil.class)
| .addListener(ZipOutputStream.class)
| .addFilter(ZipExporter.class, "*")
| .addLibrary("org/jboss/shrinkwrap/impl/base/importer/test.zip");
| .specializes(PersistenceArchive.class)
| .setPersistenceProvider(HibernatePersistence.class);
A PersistenceArchive received the archive as a param and can build upon the basic APIs like addInputStreamAsFile etc)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257362#4257362
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257362
15 years, 3 months
[JBoss Web Development] - DB connection problem on JBoss/Linux
by sbutt
Hi Folks,
I'm having problems in connecting to a mySql DB through JDBC on JBoss.
I'm using the following code.
try
| {
| String userName = "admin";
| String password = "m9ad3e";
| String url = "jdbc:mysql://hh-linux1/IntegraDB";
| Class.forName ("com.mysql.jdbc.Driver").newInstance ();
| conn = DriverManager.getConnection (url, userName, password);
| System.out.println ("Database connection established");
|
|
| }
| catch (Exception e)
| {
| e.printStackTrace();
| System.err.println ("Cannot connect to database server");
| }
It works fine on Windows/Tomcat.
But when i deploy the .war file on JBoss server running on linux it gives exception.
java.sql.SQLException: Access denied for user 'admin'@'HH-Linux1.usbeck.de' (using password: YES)
| 2009-09-28 12:56:09,844 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
| 2009-09-28 12:56:09,844 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:798)
| 2009-09-28 12:56:09,844 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3700)
| 2009-09-28 12:56:09,844 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1203)
|
it is even trying to connect to some other server somehow admin'@'HH-Linux1.usbeck.de'?
Can someone pls help.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257321#4257321
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257321
15 years, 3 months
[JBoss Web Development] - web.xml + jsp deployment problem on Jboss
by sbutt
Hi people,
I have an eclipse project that has 1 servlet and 1 jsp page. I'm having problem in deployment on Jboss. The servlet works fine but jsp is not accessible. The structure of my web.xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
| <display-name>IBNSubscriberServlet</display-name>
| <servlet>
| <description></description>
| <display-name>SubscriberServlet</display-name>
| <servlet-name>SubscriberServlet</servlet-name>
| <servlet-class>com.ibn.servlets.SubscriberServlet</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>SubscriberServlet</servlet-name>
| <url-pattern>/SubscriberServlet</url-pattern>
| </servlet-mapping>
|
| <welcome-file-list>
| <welcome-file>index.html</welcome-file>
| <welcome-file>index.htm</welcome-file>
| <welcome-file>index.jsp</welcome-file>
| <welcome-file>default.html</welcome-file>
| <welcome-file>default.htm</welcome-file>
| <welcome-file>default.jsp</welcome-file>
| </welcome-file-list>
| </web-app>
Do I need to define mappings for the JSP as well? Infact i did that too, like the following :
<?xml version="1.0" encoding="UTF-8"?>
| <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
| <display-name>IBNSubscriberServlet</display-name>
| <servlet>
| <description></description>
| <display-name>SubscriberServlet</display-name>
| <servlet-name>SubscriberServlet</servlet-name>
| <servlet-class>com.ibn.servlets.SubscriberServlet</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>SubscriberServlet</servlet-name>
| <url-pattern>/SubscriberServlet</url-pattern>
| </servlet-mapping>
|
|
| <servlet>
| <servlet-name>MonitoringG7</servlet-name>
| <jsp-file>/com.ibn.view.MonitoringG7.jsp</jsp-file>
| </servlet>
| <servlet-mapping>
| <servlet-name>MonitoringG7</servlet-name>
| <url-pattern>/*</url-pattern>
| </servlet-mapping>
|
| <welcome-file-list>
| <welcome-file>index.html</welcome-file>
| <welcome-file>index.htm</welcome-file>
| <welcome-file>index.jsp</welcome-file>
| <welcome-file>default.html</welcome-file>
| <welcome-file>default.htm</welcome-file>
| <welcome-file>default.jsp</welcome-file>
| </welcome-file-list>
| </web-app>
|
but still no success.
The strange thing is that the Servlet and JSP both work when i run the project in Tomcat (without any JSP specific mappings in web.xml), but on deploying the .war file on JBoss the JSP is not accessible, servlet works fine.
I get this error on accessing http://192.168.77.200:8080/IBNSubscriberServlet/view/MonitoringG7.jsp the JSP:
HTTP Status 404 - /IBNSubscriberServlet/view/MonitoringG7.jsp
|
| type Status report
|
| message /IBNSubscriberServlet/view/MonitoringG7.jsp
|
| description The requested resource (/IBNSubscriberServlet/view/MonitoringG7.jsp) is not available.
I looked into Jboss log file as well:
\\\Secure FTP Connections\DevServer\opt\integra\middleware\jboss-4.2.3.GA\server\default\log\
|
but nothing there about my JSP.
My JSP is under /view folder inside WebContent (eclipse project).
I have also unwar the file and it has the same directory structure as my Tomcat/Eclipse project shows.
So could anybody guide me where things are going wrong in this very simple scenario?
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257261#4257261
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257261
15 years, 3 months