-1

I want to test my war file on remote server but it is not working and giving me error:

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream cannot be cast to com.itextpdf.text.pdf.codec.Base64$InputStream

I dont know what i am doing wrong.I am new to arquillian and have checked almost all the links available but still not got any solution over this..

Here is my arquillian.xml

<?xml version="1.0" encoding="UTF-8"?>



<arquillian xmlns="http://jboss.org/schema/arquillian"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jboss.org/schema/arquillian
        http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <!-- Uncomment to have test archives exported to the file system for inspection -->
    <!-- <engine> -->
    <!-- <property name="deploymentExportPath">target/</property> -->
    <!-- </engine> -->

    <!-- Force the use of the Servlet 3.0 protocol with all containers, as it 
        is the most mature -->
    <defaultProtocol type="Servlet 3.0" />

    <!-- Example configuration for a remote JBoss EAP 6 instance -->
    <container qualifier="jboss" default="true">
        <!-- By default, arquillian will use the JBOSS_HOME environment variable. 
            Alternatively, the configuration below can be uncommented. -->
        <configuration>
            <!-- <property name="jbossHome">/opt/jboss7</property> -->      <!-- <property name="managementAddress">197.242.148.253</property> <property 
                name="managementPort">22000</property> <property name="username"></property> 
                <property name="password"></property> -->


            <property name="managementAddress">197.242.148.253</property>
            <property name="managementPort">22000</property>
            <property name="username">abc</property>
            <property name="password">aabc123</property>



        </configuration>

    </container>

</arquillian>

This is my test class

public class ArqTest extends Arquillian{


       //creates war and deploys it
        @Deployment(testable = true)
        public static WebArchive createNotTestableDeployment() {
            final WebArchive war = ShrinkWrap.create(WebArchive.class, "USSD.war")
                    .addClasses(ShowConversations.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
         System.out.println("deployed");
         System.out.println(war.getName());
            return war;
        }



     @RunAsClient
     @Test(dataProvider = Arquillian.ARQUILLIAN_DATA_PROVIDER)
       public void Test() throws IOException {



                URL url = new URL("http://197.242.148.253");
                InputStream is = (InputStream) url.openStream();
                BufferedReader br = new BufferedReader(new
                InputStreamReader(is));
                String result = br.readLine();


                System.out.println(result+"hello");
            br.close();


        }
}

Can any body provide me some help over this

kirti
  • 4,499
  • 4
  • 31
  • 60

1 Answers1

1

Try to add at the configuration node the next property:

<property name="allowConnectingToRunningServer">true</property>

Dunno if this will solve your error but I think you need it because, if not, arquillian tries to create a new jBoss instance instead of using the remote running one.

dcalap
  • 1,048
  • 2
  • 13
  • 37